コード例 #1
0
    def test_extract_params_with_embedded_dictionary(self):

        _dict = {'US': [{'New York': ['Queens', 'New York', 'Brooklyn']}, 'Virginia', 'Washington DC', 'Maryland'],
                 'Canada': ['Ontario', 'Quebec', 'British Columbia']}
        expected = sorted(['Queens', 'New York', 'Brooklyn', 'Virginia', 'Washington DC', 'Maryland', 'Ontario',
                           'Quebec', 'British Columbia'])
        extracted = sorted(c.extract_params(_dict))
        self.assertEqual(extracted, expected)
コード例 #2
0
    def test_extract_params_with_embedded_dictionary(self):

        _dict = {
            'US': [{
                'New York': ['Queens', 'New York', 'Brooklyn']
            }, 'Virginia', 'Washington DC', 'Maryland'],
            'Canada': ['Ontario', 'Quebec', 'British Columbia']
        }
        expected = sorted([
            'Queens', 'New York', 'Brooklyn', 'Virginia', 'Washington DC',
            'Maryland', 'Ontario', 'Quebec', 'British Columbia'
        ])
        extracted = sorted(c.extract_params(_dict))
        self.assertEqual(extracted, expected)
コード例 #3
0
 def test_extract_params_with_simple_dictionary(self):
     _dict = {'unix': ['Linux', 'Mac', 'Solaris'], 'windows': 'None'}
     expected = sorted(['Linux', 'Mac', 'Solaris', 'None'])
     extracted = sorted(c.extract_params(_dict))
     self.assertEqual(extracted, expected)
コード例 #4
0
 def test_extract_params_with_simple_dictionary(self):
     _dict = {'unix': ['Linux', 'Mac', 'Solaris'], 'windows': 'None'}
     expected = sorted(['Linux', 'Mac', 'Solaris', 'None'])
     extracted = sorted(c.extract_params(_dict))
     self.assertEqual(extracted, expected)