コード例 #1
0
def test_CollectTrackingOutputFileEntries0():
    '''
  Test for locating tracking results (empty)
  '''
    removeTrackingOutputFiles("test_output.bin")
    entries = collectTrackingOutputFileEntries("test_output.bin")
    assert isinstance(entries, list)
    assert len(entries) == 0
コード例 #2
0
def test_CollectTrackingOutputFileEntries0():
  '''
  Test for locating tracking results (empty)
  '''
  removeTrackingOutputFiles("test_output.bin")
  entries = collectTrackingOutputFileEntries("test_output.bin")
  assert isinstance(entries, list)
  assert len(entries) == 0
コード例 #3
0
def test_RemoveTrackingOutputFiles():
  '''
  File system cleanup test
  '''
  aName1, rName1 = createTrackingOutputFileNames("test_output.bin", 1, "l1ca")
  aName2, rName2 = createTrackingOutputFileNames("test_output.bin", 2, "l1ca")
  aName3, rName3 = createTrackingOutputFileNames("test_output.bin", 1, "l2c")
  for f in [aName1, aName2, aName3, rName1, rName2, rName3]:
    with file(f, "wb"):
      pass
  removeTrackingOutputFiles("test_output.bin")
  entries = collectTrackingOutputFileEntries("test_output.bin")
  assert isinstance(entries, list)
  assert len(entries) == 0
コード例 #4
0
def test_RemoveTrackingOutputFiles():
    '''
  File system cleanup test
  '''
    aName1, rName1 = createTrackingOutputFileNames("test_output.bin", 1,
                                                   "l1ca")
    aName2, rName2 = createTrackingOutputFileNames("test_output.bin", 2,
                                                   "l1ca")
    aName3, rName3 = createTrackingOutputFileNames("test_output.bin", 1, "l2c")
    for f in [aName1, aName2, aName3, rName1, rName2, rName3]:
        with file(f, "wb"):
            pass
    removeTrackingOutputFiles("test_output.bin")
    entries = collectTrackingOutputFileEntries("test_output.bin")
    assert isinstance(entries, list)
    assert len(entries) == 0
コード例 #5
0
def test_CollectTrackingOutputFileEntries1():
  '''
  Test for locating tracking results (non-empty)
  '''
  removeTrackingOutputFiles("test_output.bin")
  aName1, rName1 = createTrackingOutputFileNames("test_output.bin", 1, "l1ca")
  aName2, rName2 = createTrackingOutputFileNames("test_output.bin", 2, "l1ca")
  aName3, rName3 = createTrackingOutputFileNames("test_output.bin", 1, "l2c")
  for f in [aName1, aName2, aName3, rName1, rName2, rName3]:
    with file(f, "wb"):
      pass

  entries = collectTrackingOutputFileEntries("test_output.bin")
  assert isinstance(entries, list)
  assert len(entries) == 3
  assert entries[0]['filename'] == rName1
  assert entries[1]['filename'] == rName2
  assert entries[2]['filename'] == rName3
  removeTrackingOutputFiles("test_output.bin")
コード例 #6
0
def test_CollectTrackingOutputFileEntries1():
    '''
  Test for locating tracking results (non-empty)
  '''
    removeTrackingOutputFiles("test_output.bin")
    aName1, rName1 = createTrackingOutputFileNames("test_output.bin", 1,
                                                   "l1ca")
    aName2, rName2 = createTrackingOutputFileNames("test_output.bin", 2,
                                                   "l1ca")
    aName3, rName3 = createTrackingOutputFileNames("test_output.bin", 1, "l2c")
    for f in [aName1, aName2, aName3, rName1, rName2, rName3]:
        with file(f, "wb"):
            pass

    entries = collectTrackingOutputFileEntries("test_output.bin")
    assert isinstance(entries, list)
    assert len(entries) == 3
    assert entries[0]['filename'] == rName1
    assert entries[1]['filename'] == rName2
    assert entries[2]['filename'] == rName3
    removeTrackingOutputFiles("test_output.bin")