~andreserl/maas/lp1459865

« back to all changes in this revision

Viewing changes to src/maasserver/models/tests/test_filesystemgroup.py

  • Committer: MAAS Lander
  • Author(s): Ricardo Banffy, Gavin Panella
  • Date: 2015-08-11 11:16:25 UTC
  • mfrom: (4167.1.11 maas)
  • Revision ID: maas_lander-20150811111625-03tptwdi2sw0ueap
[r=blake-rouse][bug=1483206][author=rbanffy] Re-enable transactions for requests. Also fixes a bunch of typos and add helpful comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1045
1045
        with ExpectedException(
1046
1046
                ValidationError,
1047
1047
                re.escape(
1048
 
                    "{'__all__': [u'RAID level 5 must have atleast 3 raid "
 
1048
                    "{'__all__': [u'RAID level 5 must have at least 3 raid "
1049
1049
                    "devices and any number of spares.']}")):
1050
1050
            factory.make_FilesystemGroup(
1051
1051
                group_type=FILESYSTEM_GROUP_TYPE.RAID_5,
1080
1080
        with ExpectedException(
1081
1081
                ValidationError,
1082
1082
                re.escape(
1083
 
                    "{'__all__': [u'RAID level 6 must have atleast 4 raid "
 
1083
                    "{'__all__': [u'RAID level 6 must have at least 4 raid "
1084
1084
                    "devices and any number of spares.']}")):
1085
1085
            factory.make_FilesystemGroup(
1086
1086
                group_type=FILESYSTEM_GROUP_TYPE.RAID_6,
1742
1742
        with ExpectedException(
1743
1743
                ValidationError,
1744
1744
                re.escape(
1745
 
                    "{'__all__': [u'RAID level 5 must have atleast 3 raid "
 
1745
                    "{'__all__': [u'RAID level 5 must have at least 3 raid "
1746
1746
                    "devices and any number of spares.']}")):
1747
1747
            RAID.objects.create_raid(
1748
1748
                name='md0',
1763
1763
        with ExpectedException(
1764
1764
                ValidationError,
1765
1765
                re.escape(
1766
 
                    "{'__all__': [u'RAID level 6 must have atleast 4 raid "
 
1766
                    "{'__all__': [u'RAID level 6 must have at least 4 raid "
1767
1767
                    "devices and any number of spares.']}")):
1768
1768
            RAID.objects.create_raid(
1769
1769
                name='md0',
1977
1977
        with ExpectedException(
1978
1978
            ValidationError,
1979
1979
            re.escape(
1980
 
                "{'__all__': [u'RAID level 6 must have atleast 4 raid "
 
1980
                "{'__all__': [u'RAID level 6 must have at least 4 raid "
1981
1981
                "devices and any number of spares.']}")):
1982
1982
            raid.remove_device(block_devices[0])
1983
1983
        self.assertEqual(4, raid.filesystems.count())
2011
2011
        with ExpectedException(
2012
2012
            ValidationError,
2013
2013
            re.escape(
2014
 
                "{'__all__': [u'RAID level 6 must have atleast 4 raid "
 
2014
                "{'__all__': [u'RAID level 6 must have at least 4 raid "
2015
2015
                "devices and any number of spares.']}")):
2016
2016
            raid.remove_partition(partitions[0])
2017
2017
        self.assertEqual(4, raid.filesystems.count())