コード例 #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)