X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tools%2Fdistchanges%2Ftests%2Ftest_changes.py;h=8fb8d1d9774a970f406418185c559fa66f7354c8;hb=refs%2Fchanges%2F13%2F51013%2F6;hp=76fc8b01302cff40f30941eda99421ca9d86fa31;hpb=a5e50bef610aa13c07dcd00bf9329f6177cb9cbf;p=integration%2Ftest.git diff --git a/tools/distchanges/tests/test_changes.py b/tools/distchanges/tests/test_changes.py index 76fc8b0130..8fb8d1d977 100644 --- a/tools/distchanges/tests/test_changes.py +++ b/tools/distchanges/tests/test_changes.py @@ -5,7 +5,9 @@ import unittest from changes import Changes REMOTE_URL = 'ssh://git.opendaylight.org:29418' -PROJECT_NAMES = ['genius', 'mdsal', 'netvirt', 'neutron', 'openflowjava', 'openflowplugin', 'ovsdb', 'yangtools'] +NETVIRT_PROJECTS = ["netvirt", "controller", "dlux", "dluxapps", "genius", "infrautils", "mdsal", "netconf", + "neutron", "odlparent", "openflowplugin", "ovsdb", "sfc", "yangtools"] +PROJECT_NAMES = NETVIRT_PROJECTS DISTRO_PATH = "/tmp/distribution-karaf" BRANCH = 'master' LIMIT = 10 @@ -19,18 +21,38 @@ class TestChanges(unittest.TestCase): @staticmethod def run_cmd(branch, distro_patch, limit, qlimit, project_names, remote_url): - changes = Changes(branch, distro_patch, limit, qlimit, project_names, remote_url) + changes = Changes(branch, distro_patch, limit, qlimit, project_names, remote_url, 0) projects = changes.run_cmd() changes.pretty_print_projects(projects) def test_run_cmd_single(self): - project_names = ['openflowplugin'] + project_names = ['netvirt'] self.run_cmd(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL) def test_run_cmd_multiple(self): project_names = PROJECT_NAMES self.run_cmd(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL) + def test_pretty_print(self): + project_names = PROJECT_NAMES + changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL) + projects = {} + for project in project_names: + projects[project] = {"commit": 1, "includes": [{'a': 1}]} + changes.pretty_print_projects(projects) + for project in project_names: + projects[project] = {"commit": 1, + "includes": [{"grantedOn": 1, "lastUpdated": 11, + "number": "12345", "subject": "This is a test for " + project}, + {"grantedOn": 2, "lastUpdated": 22, + "number": "56789", "subject": "This is a test for " + project}]} + changes.pretty_print_projects(projects) + + def test_epoch_to_utc(self): + project_names = PROJECT_NAMES + changes = Changes(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL) + print("utc: %s" % changes.epoch_to_utc(1483974872)) + if __name__ == '__main__': unittest.main()