Load local text files of any kind - code, txts, json etc (#1076)
This commit is contained in:
@@ -85,10 +85,10 @@ class TestApp(unittest.TestCase):
|
||||
detect_datatype(["foo", "bar"])
|
||||
|
||||
@patch("os.path.isfile")
|
||||
def test_detect_datatype_regular_filesystem_file_not_detected(self, mock_isfile):
|
||||
def test_detect_datatype_regular_filesystem_file_txt(self, mock_isfile):
|
||||
with tempfile.NamedTemporaryFile(suffix=".txt", delete=True) as tmp:
|
||||
mock_isfile.return_value = True
|
||||
self.assertEqual(detect_datatype(tmp.name), DataType.TEXT)
|
||||
self.assertEqual(detect_datatype(tmp.name), DataType.TEXT_FILE)
|
||||
|
||||
def test_detect_datatype_regular_filesystem_no_file(self):
|
||||
"""Test that if a filepath is not actually an existing file, it is not handled as a file path."""
|
||||
|
||||
Reference in New Issue
Block a user