def test_main_match_ram(self):
     input_data = {}
     input_data['uname_a'] = UNAME_A_CORRECT
     input_data['proc_cpuinfo'] = CPUINFO_CORRECT
     input_data['proc_meminfo'] = MEMINFO_WRONG
     expected = {'errors': [
         'RAM size 2075004.0 kB is below minimal requirement of 4194304 kB'
     ]}
     self.assertEquals(expected, sat5_hw_reqs.main(input_data))
 def test_main_match_cpu(self):
     input_data = {}
     input_data['uname_a'] = UNAME_A_CORRECT
     input_data['proc_cpuinfo'] = CPUINFO_WRONG
     input_data['proc_meminfo'] = MEMINFO_CORRECT
     expected = {'errors': [
         'CPU speed 1595 MHz is below minimal requirement of 2400 MHz'
     ]}
     self.assertEquals(expected, sat5_hw_reqs.main(input_data))
 def test_main_match_cpu(self):
     input_data = {}
     input_data['uname_a'] = UNAME_A_CORRECT
     input_data['proc_cpuinfo'] = CPUINFO_WRONG
     input_data['proc_meminfo'] = MEMINFO_CORRECT
     expected = {
         'errors':
         ['CPU speed 1595 MHz is below minimal requirement of 2400 MHz']
     }
     self.assertEquals(expected, sat5_hw_reqs.main(input_data))
 def test_main_match_both(self):
     input_data = {}
     input_data['uname_m'] = UNAME_M_CORRECT
     input_data['proc_cpuinfo'] = CPUINFO_WRONG
     input_data['proc_meminfo'] = MEMINFO_WRONG
     expected = {'errors': [
         'CPU speed 1595 MHz is below minimal requirement of 2400 MHz',
         'RAM size 2075004.0 kB is below minimal requirement of 4194304 kB'
     ]}
     self.assertEquals(expected, sat5_hw_reqs.main(input_data))
 def test_main_match_ram(self):
     input_data = {}
     input_data['uname_a'] = UNAME_A_CORRECT
     input_data['proc_cpuinfo'] = CPUINFO_CORRECT
     input_data['proc_meminfo'] = MEMINFO_WRONG
     expected = {
         'errors': [
             'RAM size 2075004.0 kB is below minimal requirement of 4194304 kB'
         ]
     }
     self.assertEquals(expected, sat5_hw_reqs.main(input_data))
示例#6
0
 def test_main_match_both(self):
     input_data = {}
     input_data['uname_m'] = UNAME_M_CORRECT
     input_data['proc_cpuinfo'] = CPUINFO_WRONG
     input_data['proc_meminfo'] = MEMINFO_WRONG
     expected = {
         'errors': [
             'CPU speed 1595 MHz is below minimal requirement of 2400 MHz',
             'RAM size 2075004.0 kB is below minimal requirement of 4194304 kB'
         ]
     }
     self.assertEquals(expected, sat5_hw_reqs.main(input_data))
 def test_main_no_match(self):
     input_data = {}
     input_data['uname_a'] = UNAME_A_CORRECT
     input_data['proc_cpuinfo'] = CPUINFO_CORRECT
     input_data['proc_meminfo'] = MEMINFO_CORRECT
     self.assertEquals(None, sat5_hw_reqs.main(input_data))
 def test_main_no_match(self):
     input_data = {}
     input_data['uname_a'] = UNAME_A_CORRECT
     input_data['proc_cpuinfo'] = CPUINFO_CORRECT
     input_data['proc_meminfo'] = MEMINFO_CORRECT
     self.assertEquals(None, sat5_hw_reqs.main(input_data))