Beispiel #1
0
    def test_access_config_by_item_no(self):
        runner = ysanity.Runner()
        native = ysanity.Native()

        config = Config([runner, native])
        self.assertEqual(format(config[0]), "ydk.models.ydktest.ydktest_sanity.Runner")
        self.assertEqual(format(config[1]), "ydk.models.ydktest.ydktest_sanity.Native")
        config.clear()
Beispiel #2
0
    def test_access_config_by_iter(self):
        runner = ysanity.Runner()
        native = ysanity.Native()

        config = Config(runner, native)
        for entity in config:
            print(entity)

        self.assertEqual(len(config), 2)
        config.clear()
Beispiel #3
0
    def test_access_config_by_key(self):
        runner = ysanity.Runner()
        native = ysanity.Native()

        config = Config(runner, native)
        for key in config.keys():
            if key=='ydktest-sanity:runner':
                self.assertEqual(config[key].path(), 'ydktest-sanity:runner')
            else:
                self.assertEqual(config[key].path(), 'ydktest-sanity:native')
        config.clear()