Esempio n. 1
0
def test_extract_ticket_number():
    data_home = _fake_datasets.get_mock_directory_path()
    issues = load_issues("matplotlib", "matplotlib", data_home=data_home)
    ticket_numbers = extract_ticket_number(issues)
    assert_equal(min(ticket_numbers), 7272)
    assert_equal(max(ticket_numbers), 7303)

    assert_true(len(extract_ticket_number(issues)), 32)
Esempio n. 2
0
def test_load_issues():
    issues = load_issues("matplotlib", "matplotlib", data_home=DATA_HOME)
    clear_data_home(data_home=DATA_HOME)
    assert_equal(issues, None)

    # Now use some mockdata
    data_home = os.path.join(dirname(__file__), "../mockdata")
    issues = load_issues("matplotlib", "matplotlib", data_home=data_home)
    assert_true(len(issues) == 32)
Esempio n. 3
0
def test_load_commits():
    commits = load_commits("matplotlib", "matplotlib", data_home=DATA_HOME)
    clear_data_home(data_home=DATA_HOME)
    assert_equal(commits, None)

    # Now use some mockdata
    data_home = os.path.join(dirname(__file__), "../mockdata")
    commits = load_commits("matplotlib", "matplotlib", data_home=data_home)
    assert_true(len(commits) == 3)
Esempio n. 4
0
def test_get_PRs():
    PRs = get_PRs("matplotlib", "matplotlib", data_home=DATA_HOME)
    clear_data_home(data_home=DATA_HOME)
    assert_equal(PRs, None)

    # Now use some mockdata
    data_home = os.path.join(dirname(__file__), "../mockdata")
    PRs = get_PRs("matplotlib", "matplotlib", data_home=data_home)
    assert_true(len(PRs) == 21)
Esempio n. 5
0
def test_load_commits():
    commits = load_commits("matplotlib", "matplotlib", data_home=DATA_HOME)
    clear_data_home(data_home=DATA_HOME)
    assert_equal(commits, None)

    # Now use some mockdata
    data_home = _fake_datasets.get_mock_directory_path()
    commits = load_commits("matplotlib", "matplotlib", data_home=data_home)
    assert_true(len(commits) == 3)
Esempio n. 6
0
def test_load_issues():
    issues = load_issues("matplotlib", "matplotlib", data_home=DATA_HOME)
    clear_data_home(data_home=DATA_HOME)
    assert_equal(issues, None)

    # Now use some mockdata
    data_home = _fake_datasets.get_mock_directory_path()
    issues = load_issues("matplotlib", "matplotlib", data_home=data_home)
    assert_true(len(issues) == 32)
Esempio n. 7
0
def test_data_home():
    # get_data_home will point to a pre-existing folder
    data_home = get_data_home(data_home=DATA_HOME)
    assert_equal(data_home, DATA_HOME)
    assert_true(os.path.exists(data_home))

    # clear_data_home will delete both the content and the folder it-self
    clear_data_home(data_home=data_home)
    assert_false(os.path.exists(data_home))

    # if the folder is missing it will be created again
    data_home = get_data_home(data_home=DATA_HOME)
    assert_true(os.path.exists(data_home))