Ejemplo n.º 1
0
	def test_log(self, error=False):
		msgs = ['Hello!', 'This is just a test...', 'Everything is fine... hopefully']
		Log.init(self.repo)

		for msg in msgs:
			Log.error(msg) if error else Log.log(msg)

		Log.close()

		with open(self.log) as f:
			i = 0
			p = '^\[[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}\] '

			if error:
				p += '\[\w+\] '

			for line in f:
				self.assertRegex(line, p + msgs[i] + '\n')
				i += 1
Ejemplo n.º 2
0
    def test_log(self, error=False):
        msgs = [
            'Hello!', 'This is just a test...',
            'Everything is fine... hopefully'
        ]
        Log.init(self.repo)

        for msg in msgs:
            Log.error(msg) if error else Log.log(msg)

        Log.close()

        with open(self.log) as f:
            i = 0
            p = '^\[[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}\] '

            if error:
                p += '\[\w+\] '

            for line in f:
                self.assertRegex(line, p + msgs[i] + '\n')
                i += 1
Ejemplo n.º 3
0
	def shutdown(status=0):
		''' Cleans up and exits with status '''
		Package.clean()
		Log.close()
		exit(status)
Ejemplo n.º 4
0
 def shutdown(status=0):
     ''' Cleans up and exits with status '''
     Package.clean()
     Log.close()
     exit(status)