Exemplo n.º 1
0
import ccy

__all__ = [
    'country', 'country_map', 'countryccy', 'countrycode', 'country_tuples'
]

ccy.set_country_map('GB', 'UK', 'United Kingdom')
ccy.set_new_country('WW', 'USD', 'World')
ccy.set_new_country('PX', 'AUD', 'Pacific Ex Japan')
ccy.set_new_country('PP', 'JPY', 'Pacific Rim')
ccy.set_new_country('LM', 'BRL', 'Latin America')

countrydb = ccy.countries
country = ccy.country
countryccy = ccy.countryccy
country_map = ccy.country_map


def countrycode(code):
    cous = countrydb()
    code = ccy.country_map(code)
    if code:
        return code
    else:
        return ''


def country_tuples():
    global _countrytup
    return _countrytup
Exemplo n.º 2
0
 def testNewCountry(self):
     try:
         set_new_country('EU', 'EUR', 'Eurozone')
     except CountryError:
         return
     self.assertTrue(False)
Exemplo n.º 3
0
import ccy

__all__ = ['country','country_map',
           'countryccy','countrycode','country_tuples']

ccy.set_country_map('GB','UK','United Kingdom')
ccy.set_new_country('WW','USD','World')
ccy.set_new_country('PX','AUD','Pacific Ex Japan')
ccy.set_new_country('PP','JPY','Pacific Rim')
ccy.set_new_country('LM','BRL','Latin America')

countrydb   = ccy.countries
country     = ccy.country
countryccy  = ccy.countryccy
country_map = ccy.country_map

def countrycode(code):
    cous = countrydb()
    code = ccy.country_map(code)
    if code:
        return code
    else:
        return ''

def country_tuples():
    global _countrytup
    return _countrytup
    
def _sort(x, y):
    if x[1] < y[1]:
Exemplo n.º 4
0
 def testNewCountry(self):
     try:
         set_new_country("EU", "EUR", "Eurozone")
     except CountryError:
         return
     self.assertTrue(False)
Exemplo n.º 5
0
def test_new_country():
    with pytest.raises(CountryError):
        set_new_country('EU', 'EUR', 'Eurozone')