Added migration tests

Change-Id: Id55de47afe7bcc108affc4372462aa4dabff6a47
Refactor - extract method

Change-Id: I62a434ca86701412b0a40f794d42c8b1ad266f29
Apply pep8 corrections

Change-Id: Iae0dca1f5727063ba7699319e8d58f8971a11605