Пример #1
0
    def test_get_valid_isins(self):
        component_under_test = Depotwerte()

        component_under_test.add('invalid isin', '-')
        component_under_test.add('valid isin', 'isin56789012')

        assert component_under_test.get_valid_isins() == ['isin56789012']
Пример #2
0
    def test_add_shouldAdd(self):
        component_under_test = Depotwerte()

        component_under_test.add(name='1name', isin='some isin')

        assert len(component_under_test.content) == 1
        assert component_under_test.content.Name[0] == '1name'
        assert component_under_test.content.ISIN[0] == 'some isin'
Пример #3
0
def test_get_isin_nach_typ():
    depotwerte = Depotwerte()
    depotwerte.add('Name_Etf1', 'ISIN_Etf1', depotwerte.TYP_ETF)
    depotwerte.add('Name_Etf2', 'ISIN_Etf2', depotwerte.TYP_ETF)
    depotwerte.add('Name_Fond', 'ISIN_Fond', depotwerte.TYP_FOND)

    result = depotwerte.get_isin_nach_typ()

    assert len(result.keys()) == 2
    assert result[depotwerte.TYP_ETF] == ['ISIN_Etf1', 'ISIN_Etf2']
    assert result[depotwerte.TYP_FOND] == ['ISIN_Fond']
Пример #4
0
def test_get_valid_isins():
    component_under_test = Depotwerte()

    component_under_test.add(name='invalid isin',
                             isin='-',
                             typ=component_under_test.TYP_ETF)
    component_under_test.add(name='valid isin',
                             isin='isin56789012',
                             typ=component_under_test.TYP_ETF)

    assert component_under_test.get_valid_isins() == ['isin56789012']
Пример #5
0
def test_get_depotwerte():
    component_under_test = Depotwerte()

    component_under_test.add(name='0name',
                             isin='0isin',
                             typ=component_under_test.TYP_ETF)
    component_under_test.add(name='1name',
                             isin='1isin',
                             typ=component_under_test.TYP_ETF)

    assert component_under_test.get_depotwerte() == ['0isin', '1isin']
Пример #6
0
def test_add_shouldAdd():
    component_under_test = Depotwerte()

    component_under_test.add(name='1name',
                             isin='some isin',
                             typ=component_under_test.TYP_ETF)

    assert len(component_under_test.content) == 1
    assert component_under_test.content.Name[0] == '1name'
    assert component_under_test.content.ISIN[0] == 'some isin'
    assert component_under_test.content.Typ[0] == component_under_test.TYP_ETF
Пример #7
0
    def test_get_depotwerte(self):
        component_under_test = Depotwerte()

        component_under_test.add(
            '0name',
            '0isin',
        )
        component_under_test.add(
            '1name',
            '1isin',
        )

        assert component_under_test.get_depotwerte() == ['0isin', '1isin']
Пример #8
0
    def test_edit_shouldEdit(self):
        component_under_test = Depotwerte()

        component_under_test.add(
            '0name',
            '0isin',
        )
        component_under_test.add(
            '1name',
            '1isin',
        )
        component_under_test.add(
            '2name',
            '2isin',
        )

        assert len(component_under_test.content) == 3
        element_before = component_under_test.get(1)
        assert element_before == {'index': 1, 'Name': '1name', 'ISIN': '1isin'}

        component_under_test.edit(index=1, name='13name', isin='13isin')

        assert len(component_under_test.content) == 3
        element_after = component_under_test.get(1)
        assert element_after == {
            'index': 1,
            'Name': '13name',
            'ISIN': '13isin'
        }