コード例 #1
0
    def test_bisect_base_properties(self):
        bisect_doc = modbs.TestCaseBisectDocument()
        bisect_doc.id = "bar"
        bisect_doc.created_on = "now"
        bisect_doc.job = "fooz"
        bisect_doc.good_commit = "1"
        bisect_doc.good_commit_date = "now"
        bisect_doc.good_commit_url = "url"
        bisect_doc.bad_commit = "2"
        bisect_doc.bad_commit_date = "now"
        bisect_doc.bad_commit_url = "url"
        bisect_doc.found_summary = "1234abcd foo: bar"
        bisect_doc.verified = "pass"
        bisect_doc.kernel = "v456.789"
        bisect_doc.log = "https://storage.org/log.txt"

        self.assertEqual(bisect_doc.id, "bar")
        self.assertEqual(bisect_doc.created_on, "now")
        self.assertEqual(bisect_doc.job, "fooz")
        self.assertEqual(bisect_doc.good_commit, "1")
        self.assertEqual(bisect_doc.good_commit_date, "now")
        self.assertEqual(bisect_doc.good_commit_url, "url")
        self.assertEqual(bisect_doc.bad_commit, "2")
        self.assertEqual(bisect_doc.bad_commit_date, "now")
        self.assertEqual(bisect_doc.bad_commit_url, "url")
        self.assertEqual(bisect_doc.found_summary, "1234abcd foo: bar")
        self.assertEqual(bisect_doc.verified, "pass")
        self.assertEqual(bisect_doc.kernel, "v456.789")
        self.assertEqual(bisect_doc.log, "https://storage.org/log.txt")
コード例 #2
0
    def test_bisect_case_to_dict(self):
        bisect_doc = modbs.TestCaseBisectDocument()
        bisect_doc.id = "bar"
        bisect_doc.board = "baz"
        bisect_doc.version = "1.0"
        bisect_doc.build_id = "build-id"
        bisect_doc.job_id = "job-id"
        bisect_doc.git_url = "https://somewhere.com/blah.git"
        bisect_doc.git_branch = "master"
        bisect_doc.kernel = "v123.456"
        bisect_doc.log = "https://storage.org/log.txt"
        bisect_doc.test_case_path = "test.case.path"
        bisect_doc.regression_id = "regr-id"
        bisect_doc.device_type = "qemu"
        bisect_doc.lab_name = "secret-lab"
        bisect_doc.plan_variant = "cunning"

        expected = {
            "_id": "bar",
            "created_on": None,
            "job": None,
            "compare_to": None,
            "good_commit": None,
            "good_commit_date": None,
            "good_commit_url": None,
            "good_summary": None,
            "bad_commit": None,
            "bad_commit_date": None,
            "bad_commit_url": None,
            "bad_summary": None,
            "version": "1.0",
            "build_id": "build-id",
            "job_id": "job-id",
            "type": "test",
            "compiler": None,
            "compiler_version": None,
            "build_environment": None,
            "arch": None,
            "defconfig": None,
            "defconfig_full": None,
            "git_url": "https://somewhere.com/blah.git",
            "git_branch": "master",
            "kernel": "v123.456",
            "log": "https://storage.org/log.txt",
            "found_summary": None,
            "checks": {},
            "test_case_path": "test.case.path",
            "regression_id": "regr-id",
            "device_type": "qemu",
            "lab_name": "secret-lab",
            "plan_variant": "cunning",
        }
        self.assertDictEqual(expected, bisect_doc.to_dict())
コード例 #3
0
 def test_bisect_case_document_collection(self):
     bisect_doc = modbs.TestCaseBisectDocument()
     self.assertEqual(bisect_doc.collection, "bisect")
コード例 #4
0
 def test_case_bisect_document(self):
     bisect_doc = modbs.TestCaseBisectDocument()
     self.assertIsInstance(bisect_doc, modbs.BisectDocument)
     self.assertIsInstance(bisect_doc, modb.BaseDocument)
コード例 #5
0
    def test_bisect_case_properties(self):
        bisect_doc = modbs.TestCaseBisectDocument()
        bisect_doc.device_type = "devboard"

        self.assertEqual(bisect_doc.device_type, "devboard")