Example #1
0
 def test1_ForGreater(self):
     strings = ValueComparsions('1.1', '1.3')
     self.assertEqual(strings.greater(), '1.3 is greater than 1.1')
Example #2
0
 def test2_ForEqual(self):
     strings = ValueComparsions('1.1', '1.1')
     self.assertEqual(strings.equal(), '1.1 is equal to 1.1')
Example #3
0
 def test3_ForNotEqual(self):
     strings = ValueComparsions('1.1', '1.3')
     self.assertNotEqual(strings.equal(), '1.1 not equal 1.3')
Example #4
0
 def test3_ForLesser(self):
     strings = ValueComparsions('1.1', '0')
     self.assertTrue(strings.lesser(), '0 is lesser than 1.1')
Example #5
0
 def test1_ForEqual(self):
     strings = ValueComparsions('1.1', '1.3')
     self.assertEqual(strings.equal(), '1.3 is not equal to 1.1')
Example #6
0
 def test2_ForLesser(self):
     strings = ValueComparsions('-1.1', '-1.3')
     self.assertNotEqual(strings.lesser(), '-1.1 is lesser than -1.3')
Example #7
0
 def test1_ForLesser(self):
     strings = ValueComparsions('1.1', '1.3')
     self.assertEqual(strings.lesser(), '1.1 is lesser than 1.3')
Example #8
0
 def test3_ForGreater(self):
     strings = ValueComparsions('1.1', '0')
     self.assertTrue(strings.greater(), '1.1 is greater than 0')
Example #9
0
 def test2_ForGreater(self):
     strings = ValueComparsions('-1.1', '-1.3')
     self.assertNotEqual(strings.greater(), '-1.3 is greater than -1.1')
Example #10
0
from twostring import ValueComparsions

if __name__ == '__main__':
    try:
        str1 = input('Enter a string Number 1\n')
        str2 = input('Enter a string Number 2 \n')
        result = ValueComparsions(str1, str2)
        if str1 == str2:
            print(result.equal())
            print(
                '{0} and {1} are not greater or \nlesser to each other'.format(
                    str1, str2))
        else:
            print(result.greater())
            print(result.equal())
            print(result.lesser())

    except ValueError:
        print('\n')
        print('_' * 42)
        print('Characters, strings are not allowed\n'
              "Please Enter only numbers \n{0}".format('_' * 42))