import unittest
from gntp.config import GrowlNotifier


class GNTPTestCase(unittest.TestCase):
	def setUp(self):
		self.growl = GrowlNotifier('GNTP unittest', ['Testing'])
		self.growl.register()

		self.notification = {
			'noteType': 'Testing',
			'title': 'Unittest Title',
			'description': 'Unittest Description',
		}

	def _notify(self, **kargs):
		for k in self.notification:
			if not k in kargs:
				kargs[k] = self.notification[k]

		return self.growl.notify(**kargs)

import unittest
from gntp.config import GrowlNotifier


class GNTPTestCase(unittest.TestCase):
	notification = {
		'noteType': 'Testing',
		'title': 'Unittest Title',
		'description': 'Unittest Description',
	}

	def setUp(self):
		self.growl = GrowlNotifier('GNTP unittest', ['Testing'])
		self.growl.register()

	def _notify(self, **kargs):
		for k in self.notification:
			if not k in kargs:
				kargs[k] = self.notification[k]

		return self.growl.notify(**kargs)

Move variables to class variables so that we have to duplicate less for child classes
Move variables to class variables so that we have to duplicate less for child classes

  import unittest
  from gntp.config import GrowlNotifier
  
  
  class GNTPTestCase(unittest.TestCase):
+ 	notification = {
+ 		'noteType': 'Testing',
+ 		'title': 'Unittest Title',
+ 		'description': 'Unittest Description',
+ 	}
+ 
  	def setUp(self):
  		self.growl = GrowlNotifier('GNTP unittest', ['Testing'])
  		self.growl.register()
- 
- 		self.notification = {
- 			'noteType': 'Testing',
- 			'title': 'Unittest Title',
- 			'description': 'Unittest Description',
- 		}
  
  	def _notify(self, **kargs):
  		for k in self.notification:
  			if not k in kargs:
  				kargs[k] = self.notification[k]
  
  		return self.growl.notify(**kargs)
  
Move variables to class variables so that we have to duplicate less for child classes
## Code Before:
import unittest
from gntp.config import GrowlNotifier


class GNTPTestCase(unittest.TestCase):
	def setUp(self):
		self.growl = GrowlNotifier('GNTP unittest', ['Testing'])
		self.growl.register()

		self.notification = {
			'noteType': 'Testing',
			'title': 'Unittest Title',
			'description': 'Unittest Description',
		}

	def _notify(self, **kargs):
		for k in self.notification:
			if not k in kargs:
				kargs[k] = self.notification[k]

		return self.growl.notify(**kargs)

## Instruction:
Move variables to class variables so that we have to duplicate less for child classes
## Code After:
import unittest
from gntp.config import GrowlNotifier


class GNTPTestCase(unittest.TestCase):
	notification = {
		'noteType': 'Testing',
		'title': 'Unittest Title',
		'description': 'Unittest Description',
	}

	def setUp(self):
		self.growl = GrowlNotifier('GNTP unittest', ['Testing'])
		self.growl.register()

	def _notify(self, **kargs):
		for k in self.notification:
			if not k in kargs:
				kargs[k] = self.notification[k]

		return self.growl.notify(**kargs)
