예제 #1
0
	def test_fuzz(self):
		fuzzcount = 1000
		maxlength = 1000
		for i in xrange(fuzzcount):
			argument = ''
			length = random.randint(0, maxlength)
			for i in xrange(length):
				character = random.randint(0, 255)
				argument = argument + chr(character)
			wildint = random.randint(0, 1)
			wild = (wildint == 0)
			resolver.bracketzap(argument, wild) 
예제 #2
0
    def test_fuzz(self):
        fuzzcount = 1000
        maxlength = 1000

        # For py2 compatibility
        if hasattr(__builtins__, "xrange"):
            myrange = xrange
        else:
            myrange = range

        for i in myrange(fuzzcount):
            argument = ''
            length = random.randint(0, maxlength)
            for i in myrange(length):
                character = random.randint(0, 255)
                argument = argument + chr(character)
            wildint = random.randint(0, 1)
            wild = (wildint == 0)
            resolver.bracketzap(argument, wild)
예제 #3
0
	def test_fuzz(self):
		fuzzcount = 1000
		maxlength = 1000

		# For py2 compatibility
		if hasattr(__builtins__, "xrange"):
			myrange = xrange
		else:
			myrange = range

		for i in myrange(fuzzcount):
			argument = ''
			length = random.randint(0, maxlength)
			for i in myrange(length):
				character = random.randint(0, 255)
				argument = argument + chr(character)
			wildint = random.randint(0, 1)
			wild = (wildint == 0)
			resolver.bracketzap(argument, wild)
예제 #4
0
	def test_emptyreversedbracketsnonwild(self):
		expected = ']['
		actual = resolver.bracketzap('][', False)
		self.assertEqual(expected, actual)
예제 #5
0
	def test_oneclosebracketnonwild(self):
		expected = ']'
		actual = resolver.bracketzap(']', False)
		self.assertEqual(expected, actual)
예제 #6
0
	def test_emptymatchedbracketsnonwild(self):
		expected = ''
		actual = resolver.bracketzap('[]', False)
		self.assertEqual(expected, actual)
예제 #7
0
	def test_oneopenbracketnonwild(self):
		expected = '['
		actual = resolver.bracketzap('[', False)
		self.assertEqual(expected, actual)
예제 #8
0
	def test_oneclosebracket(self):
		expected = ']'
		actual = resolver.bracketzap(']')
		self.assertEqual(expected, actual)
예제 #9
0
 def test_oneclosebracket(self):
     expected = ']'
     actual = resolver.bracketzap(']')
     self.assertEqual(expected, actual)
예제 #10
0
	def test_oneopenbracket(self):
		expected = '['
		actual = resolver.bracketzap('[')
		self.assertEqual(expected, actual)
예제 #11
0
 def test_oneopenbracket(self):
     expected = '['
     actual = resolver.bracketzap('[')
     self.assertEqual(expected, actual)
예제 #12
0
 def test_emptystringnonwild(self):
     expected = ''
     actual = resolver.bracketzap('', False)
     self.assertEqual(expected, actual)
예제 #13
0
 def test_vmatch(self):
     expected = '-*'
     actual = resolver.bracketzap('[-v]')
     self.assertEqual(expected, actual)
예제 #14
0
 def test_vmatchnonwild(self):
     expected = ''
     actual = resolver.bracketzap('[-v]', False)
     self.assertEqual(expected, actual)
예제 #15
0
 def test_emptyreversedbracketsnonwild(self):
     expected = ']['
     actual = resolver.bracketzap('][', False)
     self.assertEqual(expected, actual)
예제 #16
0
 def test_emptymatchedbracketsnonwild(self):
     expected = ''
     actual = resolver.bracketzap('[]', False)
     self.assertEqual(expected, actual)
예제 #17
0
 def test_oneclosebracketnonwild(self):
     expected = ']'
     actual = resolver.bracketzap(']', False)
     self.assertEqual(expected, actual)
예제 #18
0
	def test_vmatch(self):
		expected = '-*'
		actual = resolver.bracketzap('[-v]')
		self.assertEqual(expected, actual)
예제 #19
0
	def test_emptystringnonwild(self):
		expected = ''
		actual = resolver.bracketzap('', False)
		self.assertEqual(expected, actual)
예제 #20
0
	def test_vmatchnonwild(self):
		expected = ''
		actual = resolver.bracketzap('[-v]', False)
		self.assertEqual(expected, actual)
예제 #21
0
 def test_oneopenbracketnonwild(self):
     expected = '['
     actual = resolver.bracketzap('[', False)
     self.assertEqual(expected, actual)
예제 #22
0
	def test_emptystring(self):
		expected = ''
		actual = resolver.bracketzap('')
		self.assertEqual(expected, actual)
예제 #23
0
 def test_emptystring(self):
     expected = ''
     actual = resolver.bracketzap('')
     self.assertEqual(expected, actual)