def test_write_read_data2(testdir): original = ({'a.py': 1.0}, {'n1': {'a.py': [1]}}, ['n1']) td = CoreTestmonData(testdir.tmpdir.strpath, 'default') td.mtimes, td.node_data, td.lastfailed = original td.write_data() td2 = CoreTestmonData(testdir.tmpdir.strpath, 'default') td2.read_data() assert original == (td2.mtimes, td2.node_data, td2.lastfailed)
def test_write_read_data2(testdir): original = ({'a.py': 1.0}, {'n1': {'a.py': [1]}}, ['n1']) td = CoreTestmonData(testdir.tmpdir.strpath, 'default') td.mtimes, td.node_data, td.lastfailed = original td.write_data() td2 = CoreTestmonData(testdir.tmpdir.strpath, 'default') td2.read_data() assert original == (td2.mtimes, td2.node_data, td2.lastfailed)
def test_write_read_data2(testdir): td = TestmonData(testdir.tmpdir.strpath, 'default') td.mtimes = {'a.py': 1.0} td.node_data = {'n1': {'a.py': [1]}} td.lastfailed = ['n1'] td.write_data() td2 = TestmonData(testdir.tmpdir.strpath, 'default') td2.read_data() assert td == td2
def test_write_read_data2(testdir): n1_node_data = {'a.py': [1]} td = CoreTestmonData(testdir.tmpdir.strpath, 'default') td.lastfailed = ['n1'] td.write_data() td.set_dependencies('n1', n1_node_data, ) td2 = CoreTestmonData(testdir.tmpdir.strpath, 'default') td2.read_data() assert td2.node_data['n1'] == n1_node_data
def test_write_read_data2(self, testdir): n1_node_data = {'test_a.py': [1]} td = CoreTestmonData(testdir.tmpdir.strpath, 'default') td.lastfailed = ['test_a.py::n1'] td.write_data() td.set_dependencies('test_a.py::n1', n1_node_data, {}) td2 = CoreTestmonData(testdir.tmpdir.strpath, 'default') td2.read_data() assert td2.node_data['test_a.py::n1'] == n1_node_data assert td2.f_tests['test_a.py'] == set(['test_a.py::n1'])
def test_variants_separation(testdir): testmon1_data = CoreTestmonData(testdir.tmpdir.strpath, variant='1') testmon1_data.node_data['node1'] = {'a.py': 1} testmon1_data.write_data() testmon2_data = CoreTestmonData(testdir.tmpdir.strpath, variant='2') testmon2_data.node_data['node1'] = {'a.py': 2} testmon2_data.write_data() testmon_check_data = CoreTestmonData(testdir.tmpdir.strpath, variant='1') assert testmon1_data.node_data['node1'] == {'a.py': 1}
def test_variants_separation(testdir): testmon1_data = CoreTestmonData(testdir.tmpdir.strpath, variant='1') testmon1_data.node_data['node1'] = {'a.py': 1} testmon1_data.write_data() testmon2_data = CoreTestmonData(testdir.tmpdir.strpath, variant='2') testmon2_data.node_data['node1'] = {'a.py': 2} testmon2_data.write_data() testmon_check_data = CoreTestmonData(testdir.tmpdir.strpath, variant='1') testmon_check_data.read_fs() assert testmon1_data.node_data['node1'] == {'a.py': 1}