예제 #1
0
    def test_get_ans_results(self):
        result_obj = "RESULT_STRING"
        results = {
            "dark": {
                self.BUILDER_HOSTNAME: result_obj
            },
            "contacted": {}
        }
        assert result_obj == builder_module.get_ans_results(
            results, self.BUILDER_HOSTNAME)

        results = {
            "contacted": {
                self.BUILDER_HOSTNAME: result_obj
            },
            "dark": {}
        }
        assert result_obj == builder_module.get_ans_results(
            results, self.BUILDER_HOSTNAME)

        results = {
            "contacted": {
                self.BUILDER_HOSTNAME: "wrong_obj"
            },
            "dark": {
                self.BUILDER_HOSTNAME: result_obj
            }
        }
        assert result_obj == builder_module.get_ans_results(
            results, self.BUILDER_HOSTNAME)

        results = {"contacted": {}, "dark": {}}
        assert {} == builder_module.get_ans_results(results,
                                                    self.BUILDER_HOSTNAME)
예제 #2
0
    def test_get_ans_results(self):
        result_obj = "RESULT_STRING"
        results = {"dark": {self.BUILDER_HOSTNAME: result_obj}, "contacted": {}}
        assert result_obj == builder_module.get_ans_results(results, self.BUILDER_HOSTNAME)

        results = {"contacted": {self.BUILDER_HOSTNAME: result_obj}, "dark": {}}
        assert result_obj == builder_module.get_ans_results(results, self.BUILDER_HOSTNAME)

        results = {"contacted": {self.BUILDER_HOSTNAME: "wrong_obj"},
                   "dark": {self.BUILDER_HOSTNAME: result_obj}}
        assert result_obj == builder_module.get_ans_results(results, self.BUILDER_HOSTNAME)

        results = {"contacted": {}, "dark": {}}
        assert {} == builder_module.get_ans_results(results, self.BUILDER_HOSTNAME)