コード例 #1
0
def test_moving_avg_not_all_zero():

    scores = utils.init_stock_scores(symbols)
    scores = ts.moving_avg_test(batch_data, scores, stats=stats)
    if all(score == 0 for score in scores.values()):
        raise AssertionError(
            'Moving average test returning all scores as zero')
コード例 #2
0
def test_trading_volume_test_returns_scores():

    scores = utils.init_stock_scores(symbols)
    scores = ts.trading_volume_test(batch_data, scores, chart=chart)
    if not (len(scores) >= 1000):
        raise AssertionError(
            'At least 1000 dividend scores listed in stock_scores dictionary')
コード例 #3
0
def test_pe_ratio_test_returns_scores():

    scores = utils.init_stock_scores(symbols)
    scores = fs.pe_ratio_test(batch_data, scores, chart=chart, stats=stats)
    if not (len(scores) >= 1000):
        raise AssertionError(
            'At least 1000 P/E ratio scores listed in stock_scores dictionary')
コード例 #4
0
def test_dividend_test_returns_scores():

    scores = utils.init_stock_scores(symbols)
    scores = fs.dividend_test(batch_data, scores)
    if not (len(scores) >= 1000):
        raise AssertionError(
            'At least 1000 dividend scores are not listed in stock_scores dictionary'
        )
コード例 #5
0
def test_net_income_test_returns_scores():

    scores = utils.init_stock_scores(symbols)
    scores = fs.net_income_test(batch_data, scores, financials=financials)
    if not (len(scores) >= 1000):
        raise AssertionError(
            'At least 1000 net income scores listed in stock_scores dictionary'
        )
コード例 #6
0
def test_current_ratio_test_returns_scores():

    scores = utils.init_stock_scores(symbols)
    scores = fs.current_ratio_test(batch_data, scores, financials=financials)
    if not (len(scores) >= 1000):
        raise AssertionError(
            'At least 1000 current ratio scores listed in stock_scores dictionary'
        )
コード例 #7
0
def test_suite_returns_scores():

    scores = utils.init_stock_scores(symbols)
    scores = ts.suite(batch_data, scores, stats=stats, splits=splits)
    if not (len(scores) >= 1000):
        raise AssertionError(
            'At least 1000 moving avg scores listed in stock_scores dictionary'
        )
コード例 #8
0
def test_net_income_test_returns_aapl_with_pos_ni_for_all_years_given():
    """
    This test assumes that AAPL will continue to have positive net income for years to come.
    May (hopefully not) need to be updated in the future. Also assumes that 5y period is used
    for Net Income test.
    """
    scores = utils.init_stock_scores(symbols)
    scores = fs.net_income_test(batch_data, scores, financials=financials)
    if not (scores['AAPL']):
        raise AssertionError('AAPL was not given a positive score')
コード例 #9
0
def test_p_to_b_not_all_zero():
    scores = utils.init_stock_scores(symbols)
    scores = fs.p_to_b_test(batch_data, scores)
    if all(score == 0 for score in scores.values()):
        raise AssertionError('Price to book test returning all scores as zero')
コード例 #10
0
def test_suite_not_all_zero():
    scores = utils.init_stock_scores(symbols)
    scores = ts.suite(batch_data, scores, stats=stats, splits=splits)
    if all(score == 0 for score in scores.values()):
        raise AssertionError('Technical suite returning all scores as zero')
コード例 #11
0
def test_trading_volume_test_not_all_zero():
    scores = utils.init_stock_scores(symbols)
    scores = ts.trading_volume_test(batch_data, scores, chart=chart)
    if all(score == 0 for score in scores.values()):
        raise AssertionError('Trading volume test returning all zero values')
コード例 #12
0
def test_net_income_test_not_all_zero():
    scores = utils.init_stock_scores(symbols)
    scores = fs.net_income_test(batch_data, scores, financials=financials)
    if all(score == 0 for score in scores.values()):
        raise AssertionError('All scores returned as zero')
コード例 #13
0
def test_splits_not_all_zero():

    scores = utils.init_stock_scores(symbols)
    scores = ts.split_test(batch_data, scores, splits=splits)
    if all(score == 0 for score in scores.values()):
        raise AssertionError('Splits test returning all scores as zero')
コード例 #14
0
def test_pe_ratio_test_not_all_zero():
    scores = utils.init_stock_scores(symbols)
    scores = fs.pe_ratio_test(batch_data, scores, chart=chart, stats=stats)
    if all(score == 0 for score in scores.values()):
        raise AssertionError(
            'Price to earnings test returning all scores as zero')
コード例 #15
0
def test_dividend_test_not_all_zero():
    scores = utils.init_stock_scores(symbols)
    scores = fs.dividend_test(batch_data, scores)
    if all(score == 0 for score in scores.values()):
        raise AssertionError('All scores are zero')
コード例 #16
0
ファイル: test_utils.py プロジェクト: publicbull/stockscore
def test_init_stock_scores_sets_all_scores_to_zero():

    stock_scores = utils.init_stock_scores(symbols)
    if not (all(scores == 0 for scores in stock_scores.values())):
        raise AssertionError('All scores set to zero')
コード例 #17
0
def test_p_to_b_test_returns_scores():
    scores = utils.init_stock_scores(symbols)
    scores = fs.p_to_b_test(batch_data, scores, stats=stats)
    if not (len(scores) >= 1000):
        raise AssertionError('At least 1000 scores for price/book test')
コード例 #18
0
def test_current_ratio_test_not_all_zero():
    scores = utils.init_stock_scores(symbols)
    scores = fs.current_ratio_test(batch_data, scores, financials=financials)
    if all(score == 0 for score in scores.values()):
        raise AssertionError('Current ratio test returned all zero scores')
コード例 #19
0
ファイル: test_utils.py プロジェクト: publicbull/stockscore
def test_init_stock_scores_returns_scores():

    stock_scores = utils.init_stock_scores(symbols)
    if not (len(stock_scores) >= 1000):
        raise AssertionError('At least 1000 stock scores initialized')
コード例 #20
0
def test_suite_not_all_zero():
    scores = utils.init_stock_scores(symbols)
    scores = fs.suite(batch_data, scores, financials=financials)
    if all(score == 0 for score in scores.values()):
        raise AssertionError('Fundamental suite returned all scores of zero')