def run_all_tests(self): for i in range(FLAGS.runs): self._run_fuzz_tests() if self._unexpected_errors > 0: sys.exit(esp_utils.red('Fuzz test failed.')) else: print esp_utils.green('Fuzz test passed.')
def run_all_tests(self): self.verify_key_restriction(); if self._failed_tests: sys.exit(esp_utils.red('%d tests passed, %d tests failed.' % ( self._passed_tests, self._failed_tests))) else: print esp_utils.green('All %d tests passed' % self._passed_tests)
def run_all_tests(self): self.verify_quota_control() if self._failed_tests: sys.exit(esp_utils.red('%d tests passed, %d tests failed.' % ( self._passed_tests, self._failed_tests))) else: print esp_utils.green('All %d tests passed' % self._passed_tests)
def run_all_tests(self): self.clear() self.verify_list_shelves([]) shelf1 = {'name': 'shelves/100', 'theme': 'Text books'} shelf1 = self.create_shelf(shelf1) self.verify_list_shelves([shelf1]) shelf2 = {'name': 'shelves/200', 'theme': 'Fiction'} shelf2 = self.create_shelf(shelf2) self.verify_list_shelves([shelf1, shelf2]) self.verify_shelf(shelf1) self.verify_shelf(shelf2) book11 = { 'name': 'books/1000', 'author': 'Graham Doggett', 'title': 'Maths for Chemist' } book11 = self.create_book(shelf1['name'], book11) self.verify_list_books(shelf1['name'], [book11]) book12 = { 'name': 'books/2000', 'author': 'George C. Comstock', 'title': 'A Text-Book of Astronomy' } book12 = self.create_book(shelf1['name'], book12) self.verify_list_books(shelf1['name'], [book11, book12]) self.verify_book(book11) self.verify_book(book12) # shelf2 is empty self.verify_list_books(shelf2['name'], []) self.delete_book(book12['name']) self.verify_list_books(shelf1['name'], [book11]) self.delete_book(book11['name']) self.verify_list_books(shelf1['name'], []) self.delete_shelf(shelf2['name']) self.delete_shelf(shelf1['name']) self.verify_list_shelves([]) if self._failed_tests: sys.exit( esp_utils.red('%d tests passed, %d tests failed.' % (self._passed_tests, self._failed_tests))) else: print esp_utils.green('All %d tests passed' % self._passed_tests)
def assertEqual(self, a, b): msg = 'assertEqual(%s, %s)' % (str(a), str(b)) if a == b: print '%s: %s' % (esp_utils.green('OK'), msg) self._passed_tests += 1 else: self.fail(msg)
def _check_for_crash(self): print "Checking for crashes..." current_status = self._get_status() initial_processes = self._initial_status['processes'] current_processes = current_status['processes'] if len(initial_processes) != len(current_processes): sys.exit( esp_utils.red( 'ESP crashed. Initial & current process numbers do not match.' )) return for i in range(len(initial_processes)): if initial_processes[i]['processId'] != current_processes[i][ 'processId']: sys.exit( esp_utils.red( 'ESP crashed. Initial & current pids do not match.')) if initial_processes[i]['startedAt'] != current_processes[i][ 'startedAt']: sys.exit( esp_utils.red( 'ESP crashed. Initial & current start times do not match.' )) print esp_utils.green('No crashes detected.')