def test_delete_data(): file_id = "test_id" fm.delete_data(file_id) path = fm.get_data_path(file_id) res = fm.get_data_info(path) eq_(res, {})
def test_get_data_info_4(): file_id = "no_info" path = fm.get_data_path(file_id) res = fm.get_data_info(path) expected = { 'id': 'no_info', 'nImages': 4, 'nLabels': 4, 'nClasses': 0, 'statistics': {}, 'name': '', 'description': '', 'update_time': '2018-08-11 23:32:41', 'create_time': '2018-08-11 23:32:58' } eq_(res, expected)
def test_get_data_info_2(): file_id = "test001" path = fm.get_data_path(file_id) res = fm.get_data_info(path) expected = { 'id': 'test001', 'nImages': 4, 'nLabels': 4, 'nClasses': 3, 'statistics': {'nameA': 2, 'nameB': 1, 'nameC': 1}, 'name': 'fashion MNIST', 'description': 'fashion MNIST', 'update_time': '2018-08-10 16:52:25', 'create_time': '2018-08-10 15:45:32' } eq_(res, expected)
def test_get_data_info_1(): file_id = "test_id" path = fm.get_data_path(file_id) res = fm.get_data_info(path) new_data = {"name": "aaaa", "description": "aaaa"} info_path = path / "info" / "info.json" expected = { 'id': file_id, 'nTexts': 0, 'nImages': 0, 'nLabels': 0, 'nClasses': 0, 'statistics': {}, 'name': new_data["name"], 'description': new_data["description"], 'update_time': fm.get_update_time(info_path), 'create_time': fm.get_create_time(path) } eq_(res, expected)
def test_get_data_info_3(): file_id = "not_exist_id" path = fm.get_data_path(file_id) res = fm.get_data_info(path) eq_(res, {})