class BlippConfigureTests(unittest2.TestCase):
    def setUp(self):
        self.sconf = BlippConfigure(initial_config={"properties":
                                                    {"configurations":
                                                     {"unis_url": "http://example.com"}}})
        self.sconf.config = deepcopy(consts.SAMPLE_CONFIG)

    def test_expand_probe_config(self):
        probe_list = self.sconf.expand_probe_config()

        ping1 = consts.PING_1
        ping2 = consts.PING_2
        self.assertTrue(ping1 in probe_list)
        self.assertTrue(ping2 in probe_list)
        self.assertTrue(len(probe_list)==4)

        probe_list2 = self.sconf.expand_probe_config()
        self.assertEqual(probe_list, probe_list2)

    def test_expand_probe_config_with_schema(self):
        self.sconf.config["properties"]["configurations"]["probes"]["pingschema"] = {
            "$schema": "file://ping-schema.json",
            "address": "iu.edu"
        }
        pingschema = consts.PING_SCHEMA
        probe_list = self.sconf.expand_probe_config()
        self.assertTrue(pingschema in probe_list)

    def test_strip_probes(self):
        sampleconf = deepcopy(consts.SAMPLE_CONFIG)
        probes = BlippConfigure._strip_probes(sampleconf)
        self.assertEqual(sampleconf, consts.SAMPLE_STRIPPED)
        self.assertEqual(probes, consts.STRIPPED_PROBES)
 def test_strip_probes(self):
     sampleconf = deepcopy(consts.SAMPLE_CONFIG)
     probes = BlippConfigure._strip_probes(sampleconf)
     self.assertEqual(sampleconf, consts.SAMPLE_STRIPPED)
     self.assertEqual(probes, consts.STRIPPED_PROBES)
 def setUp(self):
     self.sconf = BlippConfigure(initial_config={"properties":
                                                 {"configurations":
                                                  {"unis_url": "http://example.com"}}})
     self.sconf.config = deepcopy(consts.SAMPLE_CONFIG)