Ejemplo n.º 1
0
def test_from_rawlog():
    str_full = " 0  00:00.00  null  either "
    str_mark = "    1     0:00.03    video start"

    rawlog = RawLog()
    rawlog.full.append(str_full)
    rawlog.marks.append(str_mark)

    log = Log.from_raw_log(rawlog)

    assert log.full == [BehaviorFull(" 0  00:00.00  null  either ")]
    assert log.marks == [Mark.from_line("    1     0:00.03    video start")]
Ejemplo n.º 2
0
def test_init_invalid_no_time():
    with pytest.raises(TypeError):
        BehaviorFull("  171         Pot entry exit          either")
Ejemplo n.º 3
0
def test_init_invalid_no_frame():
    with pytest.raises(TypeError):
        BehaviorFull("       0:05.70    Pot entry exit          either")
Ejemplo n.º 4
0
def test_init_invalid_nonnumeric_time():
    with pytest.raises(TypeError):
        BehaviorFull("  171     a0:05.70    Pot entry exit          either")
Ejemplo n.º 5
0
def test_init_valid_negative_time():
    BehaviorFull("  171     -0:05.70    Pot entry exit          either")
Ejemplo n.º 6
0
def test_init_invalid_subject():
    with pytest.raises(TypeError):
        BehaviorFull("  171     0:05.70  Pot entry exit          both")
Ejemplo n.º 7
0
def test_init_valid_long_time():
    BehaviorFull("  171     0:01:05.70    Pot entry exit          either")
Ejemplo n.º 8
0
def test_lt_equal():
    one = BehaviorFull("  171     0:01:05.70    Pot entry exit      either")
    two = BehaviorFull("  171     0:01:05.70    Pot entry exit      either")

    assert one >= two
Ejemplo n.º 9
0
def test_init_invalid_raw_behavior():
    with pytest.raises(TypeError):
        BehaviorFull("53946     29:58.20     C")
Ejemplo n.º 10
0
def test_lt_description_lexicographic():
    one = BehaviorFull("  171     0:01:05.70    Pot entry exit      either")
    two = BehaviorFull("  171     0:01:05.70    pot entry exit      either")

    assert one < two
Ejemplo n.º 11
0
def test_lt_subject_lexicographic():
    one = BehaviorFull("  171     0:01:05.70    Pot entry exit      either")
    one.subject = "Either"  # Needed to avoid validator rejecting subject
    two = BehaviorFull("  171     0:01:05.70    Pot entry exit      either")

    assert one < two
Ejemplo n.º 12
0
def test_lt_description():
    one = BehaviorFull("  171     0:01:05.70    Aot entry exit      either")
    two = BehaviorFull("  171     0:01:05.70    Pot entry exit      either")

    assert one < two
Ejemplo n.º 13
0
def test_lt_time_both_signs():
    one = BehaviorFull("  171     -0:01:05.70    Pot entry exit      either")
    two = BehaviorFull("  171     0:01:05.70    Pot entry exit      either")

    assert one < two
Ejemplo n.º 14
0
def test_lt_time_negative():
    one = BehaviorFull("  171     -0:01:05.70    Pot entry exit      either")
    two = BehaviorFull("  171     -0:00:05.70    Pot entry exit      either")

    assert one < two
Ejemplo n.º 15
0
def test_init_invalid_5_elems():
    with pytest.raises(TypeError):
        BehaviorFull("|  171   0:05.70  Pot entry exit   either  ")
Ejemplo n.º 16
0
def test_init_invalid_time_no_decimal_points():
    with pytest.raises(TypeError):
        BehaviorFull("  171     0:05:70    Pot entry exit          either")
Ejemplo n.º 17
0
def test_init_invalid_behavior():
    with pytest.raises(TypeError):
        BehaviorFull("  171     0:05.70  Pot entry exit!          either")
Ejemplo n.º 18
0
def test_init_invalid_no_description():
    with pytest.raises(TypeError):
        BehaviorFull("  171     0:05.70              either")
Ejemplo n.º 19
0
def test_init_valid_normal():
    BehaviorFull("  171     28:52.70    Pot entry exit          either")
Ejemplo n.º 20
0
def test_init_valid_negative_frame():
    BehaviorFull("  -171     0:05.70    Pot entry exit          either")
Ejemplo n.º 21
0
def test_lt_frame_positive():
    one = BehaviorFull("  171     0:01:05.70    Pot entry exit      either")
    two = BehaviorFull("  173     0:01:05.70    Pot entry exit      either")

    assert one < two
Ejemplo n.º 22
0
def test_constructor():
    log = Log()
    assert log.full == [BehaviorFull(" 0  00:00.00  null  either ")]
    assert log.marks == [Mark(0, timedelta(0), "")]