def test_get_test_views(self):
        tests = rpc_interface.get_test_views()

        self.assertEquals(len(tests), 3)
        test = rpc_interface.get_test_views(job_name="myjob1", test_name="mytest1")[0]
        self.assertEquals(tests[0], test)

        self._check_for_get_test_views(test)

        self.assertEquals([], rpc_interface.get_test_views(hostname="fakehost"))
    def test_get_test_views_filter_on_attributes(self):
        tests = rpc_interface.get_test_views(include_attributes_where='attribute = "myattr" ' 'and value = "myval"')
        self._check_test_names(tests, ["mytest1"])

        tests = rpc_interface.get_test_views(exclude_attributes_where='attribute="myattr2"')
        self._check_test_names(tests, ["mytest2", "kernbench"])
    def test_get_test_views_filter_on_labels(self):
        tests = rpc_interface.get_test_views(include_labels=["testlabel1"])
        self._check_test_names(tests, ["mytest1"])

        tests = rpc_interface.get_test_views(exclude_labels=["testlabel1"])
        self._check_test_names(tests, ["mytest2", "kernbench"])