mirror of
				https://github.com/github/octodns.git
				synced 2024-05-11 05:55:00 +00:00 
			
		
		
		
	Merge branch 'master' into azuredns-dynamic
This commit is contained in:
		@@ -3413,7 +3413,7 @@ class TestDynamicRecords(TestCase):
 | 
			
		||||
        self.assertEquals(['pool "one" is missing values'],
 | 
			
		||||
                          ctx.exception.reasons)
 | 
			
		||||
 | 
			
		||||
        # pool valu not a dict
 | 
			
		||||
        # pool value not a dict
 | 
			
		||||
        a_data = {
 | 
			
		||||
            'dynamic': {
 | 
			
		||||
                'pools': {
 | 
			
		||||
@@ -3597,6 +3597,33 @@ class TestDynamicRecords(TestCase):
 | 
			
		||||
        self.assertEquals(['invalid weight "foo" in pool "three" value 2'],
 | 
			
		||||
                          ctx.exception.reasons)
 | 
			
		||||
 | 
			
		||||
        # single value with weight!=1
 | 
			
		||||
        a_data = {
 | 
			
		||||
            'dynamic': {
 | 
			
		||||
                'pools': {
 | 
			
		||||
                    'one': {
 | 
			
		||||
                        'values': [{
 | 
			
		||||
                            'weight': 12,
 | 
			
		||||
                            'value': '6.6.6.6',
 | 
			
		||||
                        }],
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
                'rules': [{
 | 
			
		||||
                    'pool': 'one',
 | 
			
		||||
                }],
 | 
			
		||||
            },
 | 
			
		||||
            'ttl': 60,
 | 
			
		||||
            'type': 'A',
 | 
			
		||||
            'values': [
 | 
			
		||||
                '1.1.1.1',
 | 
			
		||||
                '2.2.2.2',
 | 
			
		||||
            ],
 | 
			
		||||
        }
 | 
			
		||||
        with self.assertRaises(ValidationError) as ctx:
 | 
			
		||||
            Record.new(self.zone, 'bad', a_data)
 | 
			
		||||
        self.assertEquals(['pool "one" has single value with weight!=1'],
 | 
			
		||||
                          ctx.exception.reasons)
 | 
			
		||||
 | 
			
		||||
        # invalid fallback
 | 
			
		||||
        a_data = {
 | 
			
		||||
            'dynamic': {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user