Skip to content

Commit

Permalink
Reorganize Unittest structure (open-mmlab#26)
Browse files Browse the repository at this point in the history
* migrate unittest files

* move test_common_modules to test_models/
  • Loading branch information
dreamerlin authored Jul 16, 2020
1 parent ad1364b commit 518015d
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_dataset.py → tests/test_data/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def check_keys_contain(result_keys, target_keys):

@classmethod
def setup_class(cls):
cls.data_prefix = osp.join(osp.dirname(__file__), 'data')
cls.data_prefix = osp.join(osp.dirname(osp.dirname(__file__)), 'data')
cls.frame_ann_file = osp.join(cls.data_prefix, 'frame_test_list.txt')
cls.video_ann_file = osp.join(cls.data_prefix, 'video_test_list.txt')
cls.action_ann_file = osp.join(cls.data_prefix,
Expand Down
File renamed without changes.
16 changes: 10 additions & 6 deletions tests/test_loading.py → tests/test_data/test_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ def check_keys_contain(result_keys, target_keys):

@classmethod
def setup_class(cls):
cls.img_path = osp.join(osp.dirname(__file__), 'data/test.jpg')
cls.video_path = osp.join(osp.dirname(__file__), 'data/test.mp4')
cls.img_dir = osp.join(osp.dirname(__file__), 'data/test_imgs')
cls.img_path = osp.join(
osp.dirname(osp.dirname(__file__)), 'data/test.jpg')
cls.video_path = osp.join(
osp.dirname(osp.dirname(__file__)), 'data/test.mp4')
cls.img_dir = osp.join(
osp.dirname(osp.dirname(__file__)), 'data/test_imgs')
cls.raw_feature_dir = osp.join(
osp.dirname(__file__), 'data/test_activitynet_features')
osp.dirname(osp.dirname(__file__)),
'data/test_activitynet_features')
cls.bsp_feature_dir = osp.join(
osp.dirname(__file__), 'data/test_bsp_features')
osp.dirname(osp.dirname(__file__)), 'data/test_bsp_features')
cls.proposals_dir = osp.join(
osp.dirname(__file__), 'data/test_proposals')
osp.dirname(osp.dirname(__file__)), 'data/test_proposals')
cls.total_frames = 5
cls.filename_tmpl = 'img_{:05}.jpg'
cls.flow_filename_tmpl = '{}_{:05d}.jpg'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _get_recognizer_cfg(fname):
These are deep copied to allow for safe modification of parameters
without influencing other tests.
"""
repo_dpath = osp.dirname(osp.dirname(__file__))
repo_dpath = osp.dirname(osp.dirname(osp.dirname(__file__)))
config_dpath = osp.join(repo_dpath, 'configs/recognition')
config_fpath = osp.join(config_dpath, fname)
if not osp.exists(config_dpath):
Expand Down

0 comments on commit 518015d

Please sign in to comment.