예제 #1
0
def test_verbose_does_not_break():
    assert abs(
        kappa.main({
            '--verbose': True,
            '--csv': True,
            '--filename': 'test/fixtures/comma_separated.txt'
        }) - 0.16) < EPSILON
예제 #2
0
def test_calculation_on_wikipedia_example_3():
    assert (
        abs(
            kappa.main({"--filename": "test/fixtures/wikipedia_example_3.txt"}) - 0.2593
        )
        < EPSILON
    )
예제 #3
0
def test_calculation_with_csvs():
    assert (
        abs(
            kappa.main(
                {"--csv": True, "--filename": "test/fixtures/comma_separated.txt"}
            )
            - 0.16
        )
        < EPSILON
    )
예제 #4
0
def test_verbose_does_not_break():
    assert (
        abs(
            kappa.main(
                {
                    "--verbose": True,
                    "--csv": True,
                    "--filename": "test/fixtures/comma_separated.txt",
                }
            )
            - 0.16
        )
        < EPSILON
    )
예제 #5
0
def test_calculation_with_csvs():
    assert abs(
        kappa.main({
            '--csv': True,
            '--filename': 'test/fixtures/comma_separated.txt'
        }) - 0.16) < EPSILON
예제 #6
0
def test_calculation_on_perfect_agreement():
    assert abs(
        kappa.main({'--filename': 'test/fixtures/perfect_agreement.txt'}) -
        1.0) < EPSILON
예제 #7
0
def test_calculation_on_wikipedia_example_3():
    assert abs(
        kappa.main({'--filename': 'test/fixtures/wikipedia_example_3.txt'}) -
        0.2593) < EPSILON
예제 #8
0
def test_all_zeroes_does_not_break():
    assert abs(kappa.main({'--filename': 'test/fixtures/all_zeroes.txt'}) - 1.0) < EPSILON
예제 #9
0
def test_verbose_does_not_break():
    assert abs(kappa.main({'--verbose': True, '--csv': True, '--filename': 'test/fixtures/comma_separated.txt'}) - 0.16) < EPSILON
예제 #10
0
def test_calculation_with_csvs():
    assert abs(kappa.main({'--csv': True, '--filename': 'test/fixtures/comma_separated.txt'}) - 0.16) < EPSILON
예제 #11
0
def test_calculation_on_perfect_agreement():
    assert (
        abs(kappa.main({"--filename": "test/fixtures/perfect_agreement.txt"}) - 1.0)
        < EPSILON
    )
예제 #12
0
def test_calculation_on_wikipedia_example_3():
    assert abs(kappa.main({'--filename': 'test/fixtures/wikipedia_example_3.txt'}) - 0.2593) < EPSILON
예제 #13
0
def test_bad_input_exits():
    with pytest.raises(IndexError):
        kappa.main({"--filename": "test/fixtures/invalid_data.txt"})

    with pytest.raises(SystemExit):
        kappa.main({"--filename": "test/fixtures/missing_data.txt"})
예제 #14
0
def test_bad_filenames_exit():
    with pytest.raises(SystemExit):
        kappa.main({"--filename": "does_not_exist.txt"})
예제 #15
0
def test_all_zeroes_does_not_break():
    assert (
        abs(kappa.main({"--filename": "test/fixtures/all_zeroes.txt"}) - 1.0) < EPSILON
    )
예제 #16
0
def test_all_zeroes_does_not_break():
    assert abs(
        kappa.main({'--filename': 'test/fixtures/all_zeroes.txt'}) -
        1.0) < EPSILON
예제 #17
0
def test_calculation_on_perfect_agreement():
    assert abs(kappa.main({'--filename': 'test/fixtures/perfect_agreement.txt'}) - 1.0) < EPSILON