Ejemplo n.º 1
0
    def test_get_specific_site_by_url(self):
        group = Group(self.group_name)
        group.create()

        site = Site(self.target_url, groups=[group.group_name])
        res1 = site.create()
        res2 = Sites().get(url=site.url)
        self.assertEqual(len(res2.json()["sites"]), 1)
        self.assertEqual(res2.json()["sites"][0], res1.json()["site"])
Ejemplo n.º 2
0
    def test_get_all_sites(self):
        group = Group(self.group_name)
        group.create()
        site = Site(self.target_url, groups=[group.group_name])
        site.create()

        res = Sites().get()
        self.assertEqual(res.json()["success"], True)
        self.assertEqual(set(res.json()["sites"][0].keys()), set(self.expected_inner_keys))
        self.assertEqual(res.json()["sites"][0]["url"], site.url)
        self.assertEqual(res.json()["sites"][0]["groups"], site.groups)
        self.assertEqual(res.json()["sites"][0]["plans"], site.plans)