def test_record(self):
    trace = MockTrace()
    osx_trace.create_trace_cmd = (lambda options: trace)
    ret = osx_trace_main('record', 'test.trace')
    assert (ret == 0)
    calls = trace.calls
    self.assertEquals(3, len(calls))
    self.assertTrue(calls[0][1])
    self.assertEquals(['-r'], calls[0][0])
    self.assertTrue(calls[1][1])
    self.assertEquals('-L', calls[1][0][0])
    self.assertEquals(2, len(calls[1][0]))
    self.assertFalse(calls[2][1])
    self.assertEquals(6, len(calls[2][0]))
    self.assertEquals('-t', calls[2][0][0])
    self.assertEquals('-R', calls[2][0][1])
    self.assertEquals('-o', calls[2][0][3])
    self.assertEquals('test.trace', calls[2][0][4])
    self.assertEquals('trace.codes', calls[2][0][5])
def test_record(self):
    trace = MockTrace()
    osx_trace.create_trace_cmd = (lambda options: trace)
    ret = osx_trace_main('record', 'test.trace')
    assert (ret == 0)
    calls = trace.calls
    self.assertEquals(3, len(calls))
    self.assertTrue(calls[0][1])
    self.assertEquals(['-r'], calls[0][0])
    self.assertTrue(calls[1][1])
    self.assertEquals('-L', calls[1][0][0])
    self.assertEquals(2, len(calls[1][0]))
    self.assertFalse(calls[2][1])
    self.assertEquals(6, len(calls[2][0]))
    self.assertEquals('-t', calls[2][0][0])
    self.assertEquals('-R', calls[2][0][1])
    self.assertEquals('-o', calls[2][0][3])
    self.assertEquals('test.trace', calls[2][0][4])
    self.assertEquals('trace.codes', calls[2][0][5])