Exemplo n.º 1
0
 def test_memory_GB_filter_with_empty_string(self):
     """Should return an empty string when None is given"""
     self.assertEqual(filters.get_memory_in_GB(None), '')
Exemplo n.º 2
0
 def test_memory_GB_filter_with_valid_string(self):
     """Should return memory in GB when given value is in kB"""
     memory = filters.get_memory_in_GB('7124000kB')
     self.assertEqual(memory, '7 GB')
     memory = filters.get_memory_in_GB('1024000kB')
     self.assertEqual(memory, '1 GB')
Exemplo n.º 3
0
 def test_memory_GB_filter_with_invalid_string(self):
     """Should return an empty string when an invalid value is given"""
     invalid_strings = ['java', '1024000KFC', 'itsover9000', '12', '1']
     for string in invalid_strings:
         memory = filters.get_memory_in_GB(string)
         self.assertEqual(memory, '')
Exemplo n.º 4
0
 def test_memory_GB_filter_with_invalid_string(self):
     """Should return an empty string when an invalid value is given"""
     invalid_strings = ["java", "1024000KFC", "itsover9000", "12", "1"]
     for string in invalid_strings:
         memory = filters.get_memory_in_GB(string)
         self.assertEqual(memory, "")