<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `ScopusAuthor` module."""

from collections import Counter
from nose.tools import assert_equal, assert_true

import scopus


au = scopus.ScopusAuthor("7004212771", refresh=True)


def test_affiliation_history():
    affs = au.affiliation_history
    assert_true(len(affs) >= 16)
    assert_true(isinstance(affs[0], scopus.scopus_affiliation.ScopusAffiliation))


def test_author_id():
    assert_equal(au.author_id, "7004212771")


def test_author_impact_factor():
    (ncites, npapers, aif) = au.author_impact_factor(refresh=False)
    expected = (504, 11, 45.81818181818182)
    assert_true(expected[0] >= ncites)
    assert_true(expected[1] >= npapers)
    assert_true(expected[2] >= aif)


def test_coauthor_url():
    expected = 'http://api.elsevier.com/content/search/author?co-author=7004212771'
    assert_equal(au.coauthor_url, expected)


def test_current_affiliation():
    expected = 'Carnegie Mellon University, Department of Chemical Engineering'
    assert_equal(au.current_affiliation, expected)


def test_date_created():
    assert_equal(au.date_created, (2005, 12, 3))


def test_firstname():
    assert_equal(au.firstname, '<NAME>.')
<commit_msg>Reverse signs<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `ScopusAuthor` module."""

from collections import Counter
from nose.tools import assert_equal, assert_true

import scopus


au = scopus.ScopusAuthor("7004212771", refresh=True)


def test_affiliation_history():
    affs = au.affiliation_history
    assert_true(len(affs) >= 16)
    assert_true(isinstance(affs[0], scopus.scopus_affiliation.ScopusAffiliation))


def test_author_id():
    assert_equal(au.author_id, "7004212771")


def test_author_impact_factor():
    (ncites, npapers, aif) = au.author_impact_factor(refresh=False)
    expected = (504, 11, 45.81818181818182)
    assert_true(expected[0] <= ncites)
    assert_true(expected[1] <= npapers)
    assert_true(expected[2] <= aif)


def test_coauthor_url():
    expected = 'http://api.elsevier.com/content/search/author?co-author=7004212771'
    assert_equal(au.coauthor_url, expected)


def test_current_affiliation():
    expected = 'Carnegie Mellon University, Department of Chemical Engineering'
    assert_equal(au.current_affiliation, expected)


def test_date_created():
    assert_equal(au.date_created, (2005, 12, 3))


def test_firstname():
    assert_equal(au.firstname, '<NAME>.')

{'fraction_non_alphanumeric': 0.12580645161290321, 'fraction_numerical': 0.05241935483870968, 'mean_word_length': 5.2025, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '908286', 'n_tokens_mistral': 956, 'n_tokens_neox': 832, 'n_words': 157}