def test_lock(self): """ Check double-lock raises exception after 60s (in 0.1s) """ with partition.MtabLock(): with mock.patch('avocado.utils.partition.time.time', mock.MagicMock(side_effect=[1, 2, 62])): self.assertRaises(partition.PartitionError, partition.MtabLock().__enter__)
def test_lock(self): """ Check double-lock raises exception after 60s (in 0.1s) """ with partition.MtabLock(): # speedup the process a bit (flexmock(time).should_receive("time").and_return(1).and_return( 2).and_return(62)) self.assertRaises(partition.PartitionError, partition.MtabLock().__enter__) flexmock_teardown()