Exemple #1
0
    def test_different_achievements(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)

        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Different Tests")
        t.categories_set(*random_category())
        t.achievement.result = "passed"
        c.add(t)

        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Different Achievements")
        t.categories_set(*random_category())
        t.achievement.result = "failed"
        c.add(t)

        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Different Achievements")
        t.categories_set(*random_category())
        t.achievement.result = "nonapplicable"
        c.add(t)

        c.upload()
Exemple #2
0
    def test_multiple_data_items_achievements(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)
        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Multiple Data Items and Achievements")
        t.categories_set(*random_category())
        t.achievement.result = "nonapplicable"
        # add image
        path = gen_rand_image_path()
        self.assertTrue(path)
        t.data_file_add(path)
        # add python file
        path = file_py_path()
        self.assertTrue(path)
        t.data_file_add(path)
        # add log file
        path = file_log_path()
        self.assertTrue(path)
        t.data_file_add(path)
        # add image
        path = gen_rand_image_path()
        self.assertTrue(path)
        t.achievement.data_file_add(path)
        # add python file
        path = file_py_path()
        self.assertTrue(path)
        t.achievement.data_file_add(path)
        # add log file
        path = file_log_path()
        self.assertTrue(path)
        t.achievement.data_file_add(path)

        c.add(t)
        c.upload()
Exemple #3
0
    def test_minimal_passed(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)

        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Minimal Test with Passed Result")
        t.categories_set(*random_category())
        t.achievement.result = "passed"

        c.add(t)
        c.upload()
Exemple #4
0
    def test_category_arg_string(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)

        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Test with Categories as String")
        t.categories_set("foo")
        t.achievement.result = random_result()

        c.add(t)
        c.upload()
Exemple #5
0
 def test_mass_upload(self):
     c = hippodclient.Container(url=URL, timeout=TIMEOUT)
     t = hippodclient.Test()
     t.submitter_set("anonymous")
     t.title_set("Mass Upload")
     t.description_plain_set("Simple Description")
     t.categories_set(*random_category())
     t.achievement.result = "nonapplicable"
     c.add(t)
     for i in range(10):
         c.upload()
Exemple #6
0
    def test_responsible(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)

        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Responsible Set Test")
        t.categories_set(*random_category())
        t.attachment.responsible_set("anonymous")
        t.achievement.result = random_result()

        c.add(t)
        c.upload()
Exemple #7
0
    def test_tags_arg_list_set(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)

        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Test with Tags as Argument List via Set")
        t.categories_set(*random_category())
        t.attachment.tags_set(*random_tags())
        t.achievement.result = random_result()

        c.add(t)
        c.upload()
Exemple #8
0
 def test_image_achievement(self):
     c = hippodclient.Container(url=URL, timeout=TIMEOUT)
     t = hippodclient.Test()
     t.submitter_set("anonymous")
     t.title_set("Image Achievement")
     t.categories_set(*random_category())
     t.achievement.result = "nonapplicable"
     image = gen_rand_image_path()
     self.assertTrue(image)
     t.achievement.data_file_add(image)
     c.add(t)
     c.upload()
Exemple #9
0
    def test_minimal_tags_category(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)

        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Minimal Test with Categories and Tags")
        t.categories_set(*random_category())
        t.attachment.tags_set("bar", "foo", "trump", "obama", "merkel",
                              "holande")
        t.attachment.references_set("ref:1", "ref:2", "ref:3", "ref:4")
        t.achievement.result = "passed"

        c.add(t)
        c.upload()
Exemple #10
0
    def mass(self):
        for i in range(5000):
            c = hippodclient.Container(url=URL, timeout=TIMEOUT)
            title = ''.join(
                random.choice(string.ascii_uppercase + string.digits)
                for _ in range(1))

            t = hippodclient.Test()
            t.submitter_set("anonymous")
            t.title_set(title)
            t.categories_set(*random_category())
            t.achievement.result = random_result()

            c.add(t)
            c.upload()
Exemple #11
0
    def test_snippet_item(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)
        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Snippet Test Item")
        t.description_plain_set("Simple Description")
        t.categories_set(*random_category())
        t.achievement.result = "nonapplicable"

        tmp_dir, graph_path = gen_snippet_file(1)
        t.snippet_file_add(graph_path, "x-snippet-python3-matplot-png")

        c.add(t)
        c.upload()
        shutil.rmtree(tmp_dir)
Exemple #12
0
    def test_markdown_minimal(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)
        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Markdown Test")
        description = """
        # This is a first level heading

        ## Second Level Heading

        ### Third level heading

        """
        t.description_markdown_set(description)
        t.categories_set(*random_category())
        t.achievement.result = "nonapplicable"

        c.add(t)
        c.upload()
Exemple #13
0
    def test_snippet_multiple_achievement(self):
        c = hippodclient.Container(url=URL, timeout=TIMEOUT)
        t = hippodclient.Test()
        t.submitter_set("anonymous")
        t.title_set("Snippet Test Achievement Multiple")
        t.description_plain_set("Simple Description")
        t.categories_set(*random_category())
        t.achievement.result = "nonapplicable"

        tmps = []
        for i in range(4):
            tmp_dir, graph_path = gen_snippet_file(i)
            t.achievement.snippet_file_add(graph_path,
                                           "x-snippet-python3-matplot-png")
            tmps.append(tmp_dir)

        c.add(t)
        c.upload()
        for tmp_dir in tmps:
            shutil.rmtree(tmp_dir)
Exemple #14
0
 def test_is_initiable(self):
     hippodclient.Test()
     hippodclient.Container(timeout=TIMEOUT)