Esempio n. 1
0
 def test_variants_true_similar_params(self):
     # change the url by adding a querystring. shouldn't affect anything.
     url = self.url.url_join('?a=z')
     fr = FuzzableRequest(url, method='GET', dc={'a': ['1'], 'b': ['bb']})
     fr_other = FuzzableRequest(
         self.url, method='GET', dc={'a': ['2'], 'b': ['cc']})
     self.assertTrue(fr.is_variant_of(fr_other))
Esempio n. 2
0
 def test_variants_true_similar_params(self):
     # change the url by adding a querystring. shouldn't affect anything.
     url = self.url.url_join('?a=z')
     fr = FuzzableRequest(url, method='GET', dc={'a': ['1'], 'b': ['bb']})
     fr_other = FuzzableRequest(self.url,
                                method='GET',
                                dc={
                                    'a': ['2'],
                                    'b': ['cc']
                                })
     self.assertTrue(fr.is_variant_of(fr_other))
Esempio n. 3
0
 def test_variants_false_diff_params_type(self):
     fr = FuzzableRequest(self.url,
                          method='GET',
                          dc={
                              'a': ['1'],
                              'b': ['1']
                          })
     fr_other = FuzzableRequest(self.url,
                                method='GET',
                                dc={
                                    'a': ['2'],
                                    'b': ['cc']
                                })
     self.assertFalse(fr.is_variant_of(fr_other))
Esempio n. 4
0
 def test_variants_true_similar_params_two(self):
     fr = FuzzableRequest(self.url, method='GET', dc={'a': ['b']})
     fr_other = FuzzableRequest(self.url, method='GET', dc={'a': ['']})
     self.assertTrue(fr.is_variant_of(fr_other))
Esempio n. 5
0
 def test_variants_false_nonetype_in_params(self):
     fr = FuzzableRequest(self.url, method='GET', dc={'a': [None]})
     fr_other = FuzzableRequest(self.url, method='GET', dc={'a': ['s']})
     self.assertFalse(fr.is_variant_of(fr_other))
Esempio n. 6
0
 def test_variants_false_diff_params_type(self):
     fr = FuzzableRequest(
         self.url, method='GET', dc={'a': ['1'], 'b': ['1']})
     fr_other = FuzzableRequest(
         self.url, method='GET', dc={'a': ['2'], 'b': ['cc']})
     self.assertFalse(fr.is_variant_of(fr_other))
Esempio n. 7
0
 def test_variants_false_diff_meths(self):
     # Different methods
     fr_get = FuzzableRequest(self.url, method='GET', dc={'a': ['1']})
     fr_post = FuzzableRequest(self.url, method='POST', dc={'a': ['1']})
     self.assertFalse(fr_get.is_variant_of(fr_post))
Esempio n. 8
0
 def test_variants_commutative(self):
     # 'is_variant_of' is commutative
     fr = FuzzableRequest(self.url, method='POST', dc={'a': ['1']})
     fr_other = FuzzableRequest(self.url, method='POST', dc={'a': ['1']})
     self.assertTrue(fr.is_variant_of(fr_other))
     self.assertTrue(fr_other.is_variant_of(fr))
Esempio n. 9
0
 def test_variants_true_similar_params_two(self):
     fr = FuzzableRequest(self.url, method='GET', dc={'a': ['b']})
     fr_other = FuzzableRequest(self.url, method='GET', dc={'a': ['']})
     self.assertTrue(fr.is_variant_of(fr_other))
Esempio n. 10
0
 def test_variants_false_nonetype_in_params(self):
     fr = FuzzableRequest(self.url, method='GET', dc={'a': [None]})
     fr_other = FuzzableRequest(self.url, method='GET', dc={'a': ['s']})
     self.assertFalse(fr.is_variant_of(fr_other))
Esempio n. 11
0
 def test_variants_false_diff_meths(self):
     # Different methods
     fr_get = FuzzableRequest(self.url, method='GET', dc={'a': ['1']})
     fr_post = FuzzableRequest(self.url, method='POST', dc={'a': ['1']})
     self.assertFalse(fr_get.is_variant_of(fr_post))
Esempio n. 12
0
 def test_variants_commutative(self):
     # 'is_variant_of' is commutative
     fr = FuzzableRequest(self.url, method='POST', dc={'a': ['1']})
     fr_other = FuzzableRequest(self.url, method='POST', dc={'a': ['1']})
     self.assertTrue(fr.is_variant_of(fr_other))
     self.assertTrue(fr_other.is_variant_of(fr))