def testFile(self):
     explorer = FileExplorer(
         Namespace(path="tests/samples/sample-data.csv",
                   catalog={"format": "ascii_table"}))
     explorer.scan()
     result = explorer.get_dict()
     self._check(result)
예제 #2
0
 def testFile(self):
     explorer = FileExplorer(
         Namespace(path="tests/samples/sample-data.csv",
                   catalog={"format": "ascii_table"}))
     explorer.scan()
     result = explorer.get_dict()
     self.assertEqual(len(result["files"]), 1)
     self.assertEqual(result["files"][0]["Mime/Type"], "text/plain")
     self.assertEqual(result["files"][0]["path"],
                      "tests/samples/sample-data.csv")
     self.assertEqual(len(result["files"][0]["pii"]), 5)
예제 #3
0
 def testDirectory(self):
     explorer = FileExplorer(
         Namespace(path="tests/samples", catalog={"format": "ascii_table"}))
     explorer.scan()
     result = explorer.get_dict()
     self.assertEqual(len(result["files"]), 2)
     self.assertEqual(result["files"][0]["Mime/Type"], "application/gzip")
     self.assertEqual(result["files"][0]["path"],
                      "tests/samples/sample-data-2.csv.gz")
     self.assertEqual(len(result["files"][1]["pii"]), 5)
     self.assertEqual(result["files"][1]["Mime/Type"], "text/plain")
     self.assertEqual(result["files"][1]["path"],
                      "tests/samples/sample-data.csv")
     self.assertEqual(len(result["files"][1]["pii"]), 5)
예제 #4
0
 def testFile(self):
     explorer = FileExplorer("tests/samples/sample-data.csv")
     explorer.scan()
     result = explorer.get_dict()
     self._check(result)
예제 #5
0
 def testDirectory(self):
     explorer = FileExplorer("tests/samples")
     explorer.scan()
     result = explorer.get_dict()
     self._check(result)
예제 #6
0
 def testDirectory(self):
     explorer = FileExplorer(
         Namespace(path="tests/samples", catalog={'format': 'ascii_table'}))
     explorer.scan()
     result = explorer.get_dict()
     self._check(result)