Ejemplo n.º 1
0
 def _test_is_list(self):
     try:
         listing=[[1,2,3],[1],(4)]
         for i in listing:
             if i == len(listing):
                 method=Val.is_list('list check',listing=i)
                 self.assertFalse(method)
             else:
                 method = Val.is_list('list check',listing=i)
                 self.assertTrue(method)
     except:
         self.assertFalse(True,self.error_message)
         traceback.print_exc()
Ejemplo n.º 2
0
 def _test_is_tuple(self):
     try:
         tple=[(1,2,3),{1:1}]
         for i in tple:
             if i == len(tple):
                 method=Val.is_tuple('tuple check',tple=i)
                 self.assertFalse(method)
             else:
                 method=Val.is_tuple('tuple check',tple=i)
                 self.assertTrue(method)
     except:
         self.assertFalse(True,"exception raised")
         traceback.print_exc()
Ejemplo n.º 3
0
 def _test_is_list(self):
     try:
         listing = [[1, 2, 3], [1], (4)]
         for i in listing:
             if i == len(listing):
                 method = Val.is_list('list check', listing=i)
                 self.assertFalse(method)
             else:
                 method = Val.is_list('list check', listing=i)
                 self.assertTrue(method)
     except:
         self.assertFalse(True, self.error_message)
         traceback.print_exc()
Ejemplo n.º 4
0
 def _test_is_tuple(self):
     try:
         tple = [(1, 2, 3), {1: 1}]
         for i in tple:
             if i == len(tple):
                 method = Val.is_tuple('tuple check', tple=i)
                 self.assertFalse(method)
             else:
                 method = Val.is_tuple('tuple check', tple=i)
                 self.assertTrue(method)
     except:
         self.assertFalse(True, "exception raised")
         traceback.print_exc()
Ejemplo n.º 5
0
    def _test_is_all(self):
        try:

            listin=[{1:'one',2:2},(1,2,3),[1,3,5]]
            for i in listin:
                if i == len(listin):
                    method=Val.is_all('check all',listin=i)
                    self.assertFalse(method)
                else:
                    method=Val.is_all('check all',listin=i)
                    self.assertTrue(method)
        except:
            self.assertFalse(True,"exception raised")
            traceback.print_exc()
Ejemplo n.º 6
0
    def _test_is_string(self):
        try:
            strings=['hi','how','are','you',89]
            for i in strings:
                if i == len(strings):
                    method=Val.is_string('strng check',strings=i)
                    self.assertFalse(method)
                else:
                    method= Val.is_string('strn check',strings=i)
                    self.assertTrue(method)

        except:
            self.assertFalse(True,self.error_message)
            traceback.print_exc()
Ejemplo n.º 7
0
    def _test_is_all(self):
        try:

            listin = [{1: 'one', 2: 2}, (1, 2, 3), [1, 3, 5]]
            for i in listin:
                if i == len(listin):
                    method = Val.is_all('check all', listin=i)
                    self.assertFalse(method)
                else:
                    method = Val.is_all('check all', listin=i)
                    self.assertTrue(method)
        except:
            self.assertFalse(True, "exception raised")
            traceback.print_exc()
Ejemplo n.º 8
0
    def _test_is_string(self):
        try:
            strings = ['hi', 'how', 'are', 'you', 89]
            for i in strings:
                if i == len(strings):
                    method = Val.is_string('strng check', strings=i)
                    self.assertFalse(method)
                else:
                    method = Val.is_string('strn check', strings=i)
                    self.assertTrue(method)

        except:
            self.assertFalse(True, self.error_message)
            traceback.print_exc()
Ejemplo n.º 9
0
    def _test_is_num(self):

        try:
            numbers = [1, 2, 3, 'sree']
            for i in numbers:
                if i == len(numbers):
                    method = Val.is_num('self', numbers=i)
                    self.assertFalse(method)
                else:
                    method = Val.is_num(self, numbers=i)
                    self.assertTrue(method)

        except:
            self.assertFalse(True, self.error_message)
            traceback.print_exc()
Ejemplo n.º 10
0
    def _test_is_num(self):

        try:
            numbers=[1,2,3,'sree']
            for i in numbers:
                if i == len(numbers):
                    method=Val.is_num('self',numbers=i)
                    self.assertFalse(method)
                else:
                    method=Val.is_num(self,numbers=i)
                    self.assertTrue(method)


        except:
            self.assertFalse(True,self.error_message)
            traceback.print_exc()
Ejemplo n.º 11
0
 def _test_funtest(self):
     try:
         print('88', self)
         self.assertTrue(Val.funtest())
     except:
         self.assertFalse(True, "exception raised")
         traceback.print_exc()
Ejemplo n.º 12
0
 def _test_funtest(self):
     try:
         print('88',self)
         self.assertTrue(Val.funtest())
     except:
         self.assertFalse(True,"exception raised")
         traceback.print_exc()
Ejemplo n.º 13
0
 def _test_ctest(self):
     try:
         self.assertTrue(Val.ctest(simpletest_case))
     except:
         self.assertFalse(True,"exception raised")
         traceback.print_exc()
Ejemplo n.º 14
0
 def test_datetime(self):
     try:
         self.assertTrue(Val.datetime('date check',"26 jan 1950"))
     except:
         self.assertFalse(True,"exception raised")
         traceback.print_exc()
Ejemplo n.º 15
0
 def _test_ctest(self):
     try:
         self.assertTrue(Val.ctest(simpletest_case))
     except:
         self.assertFalse(True, "exception raised")
         traceback.print_exc()
Ejemplo n.º 16
0
 def test_is_num(self):
     try:
         method = Val.is_num('num check', numbers='123')
     except:
         traceback.print_exc()
         raise
Ejemplo n.º 17
0
 def test_is_num(self):
     try:
         method=Val.is_num('num check',numbers='123')
     except:
         traceback.print_exc()
         raise
Ejemplo n.º 18
0
 def test_datetime(self):
     try:
         self.assertTrue(Val.datetime('date check', "26 jan 1950"))
     except:
         self.assertFalse(True, "exception raised")
         traceback.print_exc()