diff --git a/tests/fixtures/test.gitconfig b/tests/fixtures/test.gitconfig index b178cf60..9b3f2574 100644 --- a/tests/fixtures/test.gitconfig +++ b/tests/fixtures/test.gitconfig @@ -11,13 +11,3 @@ intk = 10k intm = 10m intg = 10g -[repo "syncstate.main"] - synctime = 2021-09-14T17:23:43.537338Z - version = 1 -[repo "syncstate.sys"] - argv = ['/usr/bin/pytest-3'] -[repo "syncstate.superproject"] - test = false -[repo "syncstate.options"] - verbose = true - mpupdate = false diff --git a/tests/test_git_config.py b/tests/test_git_config.py index faf12a2e..a4fad9ef 100644 --- a/tests/test_git_config.py +++ b/tests/test_git_config.py @@ -104,25 +104,6 @@ class GitConfigReadOnlyTests(unittest.TestCase): for key, value in TESTS: self.assertEqual(value, self.config.GetInt('section.%s' % (key,))) - def test_GetSyncAnalysisStateData(self): - """Test config entries with a sync state analysis data.""" - superproject_logging_data = {} - superproject_logging_data['test'] = False - options = type('options', (object,), {})() - options.verbose = 'true' - options.mp_update = 'false' - TESTS = ( - ('superproject.test', 'false'), - ('options.verbose', 'true'), - ('options.mpupdate', 'false'), - ('main.version', '1'), - ) - self.config.UpdateSyncAnalysisState(options, superproject_logging_data) - sync_data = self.config.GetSyncAnalysisStateData() - for key, value in TESTS: - self.assertEqual(sync_data[f'{git_config.SYNC_STATE_PREFIX}{key}'], value) - self.assertTrue(sync_data[f'{git_config.SYNC_STATE_PREFIX}main.synctime']) - class GitConfigReadWriteTests(unittest.TestCase): """Read/write tests of the GitConfig class.""" @@ -187,6 +168,25 @@ class GitConfigReadWriteTests(unittest.TestCase): config = self.get_config() self.assertIsNone(config.GetBoolean('foo.bar')) + def test_GetSyncAnalysisStateData(self): + """Test config entries with a sync state analysis data.""" + superproject_logging_data = {} + superproject_logging_data['test'] = False + options = type('options', (object,), {})() + options.verbose = 'true' + options.mp_update = 'false' + TESTS = ( + ('superproject.test', 'false'), + ('options.verbose', 'true'), + ('options.mpupdate', 'false'), + ('main.version', '1'), + ) + self.config.UpdateSyncAnalysisState(options, superproject_logging_data) + sync_data = self.config.GetSyncAnalysisStateData() + for key, value in TESTS: + self.assertEqual(sync_data[f'{git_config.SYNC_STATE_PREFIX}{key}'], value) + self.assertTrue(sync_data[f'{git_config.SYNC_STATE_PREFIX}main.synctime']) + if __name__ == '__main__': unittest.main()