def test_model_properties_are_not_filtered_out(self): creds = { "basic": str(uuid.uuid4()).replace("-", ""), "mac": str(uuid.uuid4()).replace("-", ""), "principal": str(uuid.uuid4()).replace("-", ""), } filtered_creds = ks_util.filter_out_non_model_creds_properties(creds) self.assertEqual(creds, filtered_creds)
def on_async_create_done(creds, is_creds_collection): self.assertIsNotNone(is_creds_collection) self.assertTrue(is_creds_collection) self.assertIsNotNone(creds) if the_is_filter_out_non_model_properties: the_creds_filtered = [ ks_util.filter_out_non_model_creds_properties(x) for x in the_creds ] self.assertEqual(creds, the_creds_filtered) else: self.assertEqual(creds, the_creds)
def on_async_create_done(creds, is_creds_collection): self.assertIsNotNone(is_creds_collection) self.assertFalse(is_creds_collection) self.assertIsNotNone(creds) if the_is_filter_out_non_model_properties: self.assertEqual( creds, ks_util.filter_out_non_model_creds_properties(the_creds)) else: self.assertEqual(creds, the_creds)
def test_non_model_properties_are_filtered_out(self): non_cred_properties = { "dave": str(uuid.uuid4()).replace("-", ""), "was": str(uuid.uuid4()).replace("-", ""), "here": str(uuid.uuid4()).replace("-", ""), } creds = { "basic": str(uuid.uuid4()).replace("-", ""), "mac": str(uuid.uuid4()).replace("-", ""), "principal": str(uuid.uuid4()).replace("-", ""), } combined_creds = dict(non_cred_properties.items() + creds.items()) filtered_creds = ks_util.filter_out_non_model_creds_properties(combined_creds) self.assertEqual(creds, filtered_creds)
def test_creds_arg_is_none(self): creds = None self.assertIsNone(ks_util.filter_out_non_model_creds_properties(creds))
def on_async_create_done(creds): self.assertIsNotNone(creds) self.assertIsNotNone(self.the_creds) self.assertEqual( creds, ks_util.filter_out_non_model_creds_properties(self.the_creds))