def test_GIVEN_non_existant_user_in_list_WHEN_get_filtered_THEN_user_is_replaced_by_default_user(self):
        nobody_username = "******"
        config = ConfigMother.test_configuration_with_values(nobody_username=nobody_username)
        client = MajicWebserviceClient(config)
        client.get_properties_list = Mock(return_value={
            JSON_MODEL_RUNS: RunModelPropertiesMother.create_model_run_properties([1], owner="non_existant_user")})

        results = client.get_properties_list_with_filtered_users()

        assert_that(results, is_(RunModelPropertiesMother.create_model_run_properties([1], owner=nobody_username)))
    def test_GIVEN_user_in_list_WHEN_get_filtered_THEN_user_kept(self):
        expected_user = getpass.getuser()
        nobody_username = "******"
        config = ConfigMother.test_configuration_with_values(nobody_username=nobody_username)
        client = MajicWebserviceClient(config)
        client.get_properties_list = Mock(return_value={
            JSON_MODEL_RUNS: RunModelPropertiesMother.create_model_run_properties([1], owner=expected_user)})

        results = client.get_properties_list_with_filtered_users()

        assert_that(results, is_(RunModelPropertiesMother.create_model_run_properties([1], owner=expected_user)))
    def test_GIVEN_majic_is_up_WHEN_get_file_properties_THEN_data_returned(self):
        config = ConfigMother.test_configuration()
        client = MajicWebserviceClient(config)

        try:
            result = client.get_properties_list()
        except WebserviceClientError as ex:
            if ex.message.startswith("There is a connection error when contacting the Majic Web Service"):
                raise self.skipTest("Connection error talking with Majic Web service")
            else:
                raise ex

        assert_that(result, is_not(None))