예제 #1
0
파일: country.py 프로젝트: smhjn/flow
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
예제 #2
0
파일: ccytests.py 프로젝트: hylje/ccy
 def testNewCountry(self):
     try:
         set_new_country('EU', 'EUR', 'Eurozone')
     except CountryError:
         return
     self.assertTrue(False)
예제 #3
0
파일: country.py 프로젝트: OspreyX/flow
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]:
예제 #4
0
파일: ccytests.py 프로젝트: glencoates/ccy
 def testNewCountry(self):
     try:
         set_new_country("EU", "EUR", "Eurozone")
     except CountryError:
         return
     self.assertTrue(False)
예제 #5
0
파일: test_ccy.py 프로젝트: alexanu/ccy
def test_new_country():
    with pytest.raises(CountryError):
        set_new_country('EU', 'EUR', 'Eurozone')