Exemplo n.º 1
0
 def test_add_remove_experiment_link(self):
     admin_auth = HmacAuth("edd", self.admin_ice_user.email)
     ice = IceApi(admin_auth)
     ice.write_enabled = True
     study = factory.StudyFactory()
     study_url = f"https://edd.example.org/s/{study.slug}/"
     for entry_id in self.db_ids:
         ice.add_experiment_link(entry_id, study.name, study_url)
     # verify link exists on a given entry
     found_links = list(ice.fetch_experiment_links(self.db_ids[3]))
     self.assertEqual(len(found_links), 1)
     # verify that removal works
     ice.unlink_entry_from_study(self.db_ids[3], study_url)
     found_links = list(ice.fetch_experiment_links(self.db_ids[3]))
     self.assertEqual(len(found_links), 0)
Exemplo n.º 2
0
 def test_write_protection(self):
     admin_auth = HmacAuth("edd", self.admin_ice_user.email)
     ice = IceApi(admin_auth)
     with self.assertRaises(IceApiException):
         ice.add_experiment_link(self.db_ids[0], "Error", "https://www.example.net/")