Skip to content

Commit 3d23362

Browse files
committed
fix: add test
1 parent af13035 commit 3d23362

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

dataprofiler/tests/labelers/test_labeler_utils.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import logging
22
import tempfile
33
import unittest
4+
from pathlib import Path
45

56
import numpy as np
67
import pandas as pd
78
import tensorflow as tf
89

9-
from dataprofiler.labelers import labeler_utils
10+
from dataprofiler.labelers import labeler_utils, utils
1011

1112

1213
class TestEvaluateAccuracy(unittest.TestCase):
@@ -294,3 +295,17 @@ def test_hide_tf_logger_warnings(self):
294295
# make change and validate updated filter
295296
labeler_utils.hide_tf_logger_warnings()
296297
self.assertEqual(1 + num_loggers, len(logger.filters))
298+
299+
300+
class TestFindResourcesDir(unittest.TestCase):
301+
def test_find_resources_dir(self):
302+
resource_dir = utils.find_resources_dir()
303+
self.assertTrue(resource_dir.is_dir())
304+
self.assertEqual(Path("resources").name, Path(str(resource_dir)).name)
305+
306+
labeler_dir = utils.find_resources_dir("labelers")
307+
self.assertTrue(labeler_dir.is_dir())
308+
self.assertEqual(Path("labelers").name, Path(str(labeler_dir)).name)
309+
310+
with self.assertRaisesRegex(FileNotFoundError, "Resource not found"):
311+
utils.find_resources_dir("does/not/exist")

0 commit comments

Comments
 (0)