Example #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
Example #2
0
def test_calculation_on_wikipedia_example_3():
    assert (
        abs(
            kappa.main({"--filename": "test/fixtures/wikipedia_example_3.txt"}) - 0.2593
        )
        < EPSILON
    )
Example #3
0
def test_calculation_with_csvs():
    assert (
        abs(
            kappa.main(
                {"--csv": True, "--filename": "test/fixtures/comma_separated.txt"}
            )
            - 0.16
        )
        < EPSILON
    )
Example #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
    )
Example #5
0
def test_calculation_with_csvs():
    assert abs(
        kappa.main({
            '--csv': True,
            '--filename': 'test/fixtures/comma_separated.txt'
        }) - 0.16) < EPSILON
Example #6
0
def test_calculation_on_perfect_agreement():
    assert abs(
        kappa.main({'--filename': 'test/fixtures/perfect_agreement.txt'}) -
        1.0) < EPSILON
Example #7
0
def test_calculation_on_wikipedia_example_3():
    assert abs(
        kappa.main({'--filename': 'test/fixtures/wikipedia_example_3.txt'}) -
        0.2593) < EPSILON
Example #8
0
def test_all_zeroes_does_not_break():
    assert abs(kappa.main({'--filename': 'test/fixtures/all_zeroes.txt'}) - 1.0) < EPSILON
Example #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
Example #10
0
def test_calculation_with_csvs():
    assert abs(kappa.main({'--csv': True, '--filename': 'test/fixtures/comma_separated.txt'}) - 0.16) < EPSILON
Example #11
0
def test_calculation_on_perfect_agreement():
    assert (
        abs(kappa.main({"--filename": "test/fixtures/perfect_agreement.txt"}) - 1.0)
        < EPSILON
    )
Example #12
0
def test_calculation_on_wikipedia_example_3():
    assert abs(kappa.main({'--filename': 'test/fixtures/wikipedia_example_3.txt'}) - 0.2593) < EPSILON
Example #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"})
Example #14
0
def test_bad_filenames_exit():
    with pytest.raises(SystemExit):
        kappa.main({"--filename": "does_not_exist.txt"})
Example #15
0
def test_all_zeroes_does_not_break():
    assert (
        abs(kappa.main({"--filename": "test/fixtures/all_zeroes.txt"}) - 1.0) < EPSILON
    )
Example #16
0
def test_all_zeroes_does_not_break():
    assert abs(
        kappa.main({'--filename': 'test/fixtures/all_zeroes.txt'}) -
        1.0) < EPSILON
Example #17
0
def test_calculation_on_perfect_agreement():
    assert abs(kappa.main({'--filename': 'test/fixtures/perfect_agreement.txt'}) - 1.0) < EPSILON