use self.patch() to override open() in unit test

Using TestCase.patch() method to override buildin open() in a unit test is
much cleaner.