Esempio n. 1
0
    def test_sampleable_get_default_sample(self):
        test = Sampleable()
        test.name = "foo"

        self.assertEqual("my_foo", test.get_default_sample())
Esempio n. 2
0
    def test_sampleable_get_sample(self):
        sampleable = Sampleable()
        sampleable.sample = "foo"

        self.assertEqual("foo", sampleable.get_sample())
Esempio n. 3
0
    def test_sampleable_get_sample__return_default_sample(self):
        sampleable = Sampleable()
        sampleable.sample = None
        sampleable.name = "bar"

        self.assertEqual("my_bar", sampleable.get_sample())
Esempio n. 4
0
    def test_set_common_datas__sampleable(self):
        datas = {"description": "c", "sample": {"foo": "bar"}}
        element = Sampleable()
        self.factory.set_common_datas(element, "o_name", datas)

        self.assertEqual("{'foo': 'bar'}", element.sample)