示例#1
0
文件: test_tags.py 项目: bjf/maasapi
    def test_tags(s):
        tags = MapiClient(s.url, s.creds).tags
        s.assertIsNotNone(tags)

        # When we are starting out there shouldn't be any tags currently defined
        # on the MAAS server.
        #
        s.assertEqual(len(tags), 0)

        # Verify we can add a tag
        #
        tags.add(Tag(name='intel-gpu', comment='Machines which have an Intel display driver', definition='contains(//node[@id="display"]/vendor, "Intel")'))
        s.assertEqual(len(tags), 1)

        # Verify we can delete the tag that we just added.
        #
        tags.delete(Tag(name='intel-gpu', comment='Machines which have an Intel display driver', definition='contains(//node[@id="display"]/vendor, "Intel")'))
        s.assertEqual(len(tags), 0)
示例#2
0
    def test_tags(s):
        tags = MapiClient(s.url, s.creds).tags
        s.assertIsNotNone(tags)

        # When we are starting out there shouldn't be any tags currently defined
        # on the MAAS server.
        #
        s.assertEqual(len(tags), 0)

        # Verify we can add a tag
        #
        tags.add(
            Tag(name='intel-gpu',
                comment='Machines which have an Intel display driver',
                definition='contains(//node[@id="display"]/vendor, "Intel")'))
        s.assertEqual(len(tags), 1)

        # Verify we can delete the tag that we just added.
        #
        tags.delete(
            Tag(name='intel-gpu',
                comment='Machines which have an Intel display driver',
                definition='contains(//node[@id="display"]/vendor, "Intel")'))
        s.assertEqual(len(tags), 0)
示例#3
0
文件: test_tag.py 项目: bjf/maasapi
 def tearDown(s):
     # Cleanup (delete) any tags that were created during testing.
     #
     tags = MapiClient(s.url, s.creds).tags
     for t in tags:
         tags.delete(t)
示例#4
0
文件: test_tag.py 项目: bjf/maasapi
 def tearDown(s):
     # Cleanup (delete) any tags that were created during testing.
     #
     tags = MapiClient(s.url, s.creds).tags
     for t in tags:
         tags.delete(t)