Esempio n. 1
0
    def test_should_return_non_empty_dict_when_scalpel_attributes_found(self):
        data = {
            'name': 'paul',
            'scalpel': {
                'min_request_delay': 1,
                'foo': 'bar',
                'USER_AGENT': 'Mozilla/5.0',
                'fruit': 'pineapple',
                '_config': 'foobar'
            }
        }
        expected = {'min_request_delay': 1, 'user_agent': 'Mozilla/5.0'}

        assert_dicts(expected, Configuration._scalpel_attributes(data))
Esempio n. 2
0
 def test_should_return_empty_dict_when_no_scalpel_attribute_found(self):
     data = {'foo': 'bar', 'timeout': 2}
     assert {} == Configuration._scalpel_attributes(data)