def testGlobalIncome_loadingdata(self):
     self.assertEqual(self.ALLDATA.countries.size, 388)
     self.assertEqual(self.ALLDATA.income.size,55380)
     self.assertSequenceEqual(list(self.ALLDATA.income.columns),[1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012])
     self.assertSequenceEqual(list(self.ALLDATA.income.index),['Abkhazia', 'Afghanistan', 'Akrotiri and Dhekelia', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antigua and Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia and Herzegovina', 'Botswana', 'Brazil', 'British Virgin Islands', 'Brunei', 'Bulgaria', 'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon', 'Canada', 'Cape Verde', 'Cayman Islands', 'Central African Rep.', 'Chad', 'Channel Islands', 'Chile', 'China', 'Christmas Island', 'Cocos Island', 'Colombia', 'Comoros', 'Congo, Dem. Rep.', 'Congo, Rep.', 'Cook Islands', 'Costa Rica', "Cote d'Ivoire", 'Croatia', 'Cuba', 'Cyprus', 'Czech Rep.', 'Czechoslovakia', 'Denmark', 'Djibouti', 'Dominica', 'Dominican Rep.', 'East Germany', 'Ecuador', 'Egypt', 'El Salvador', 'Equatorial Guinea', 'Eritrea', 'Eritrea and Ethiopia', 'Estonia', 'Ethiopia', 'Faeroe Islands', 'Falkland Islands (Malvinas)', 'Fiji', 'Finland', 'France', 'French Guiana', 'French Polynesia', 'Gabon', 'Gambia', 'Georgia', 'Germany', 'Ghana', 'Gibraltar', 'Greece', 'Greenland', 'Grenada', 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana', 'Haiti', 'Holy See', 'Honduras', 'Hong Kong, China', 'Hungary', 'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Ireland', 'Isle of Man', 'Israel', 'Italy', 'Jamaica', 'Japan', 'Jersey', 'Jordan', 'Kazakhstan', 'Kenya', 'Kiribati', 'Korea, Dem. Rep.', 'Korea, Rep.', 'Korea, United', 'Kosovo', 'Kuwait', 'Kyrgyzstan', 'Laos', 'Latvia', 'Lebanon', 'Lesotho', 'Liberia', 'Libya', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Macao, China', 'Macedonia, FYR', 'Madagascar', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta', 'Marshall Islands', 'Martinique', 'Mauritania', 'Mauritius', 'Mayotte', 'Mexico', 'Micronesia, Fed. Sts.', 'Moldova', 'Monaco', 'Mongolia', 'Montenegro', 'Montserrat', 'Morocco', 'Mozambique', 'Myanmar', 'Nagorno-Karabakh', 'Namibia', 'Nauru', 'Nepal', 'Netherlands', 'Netherlands Antilles', 'New Caledonia', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Norfolk Island', 'Northern Cyprus', 'Northern Mariana Islands', 'Norway', 'Oman', 'Pakistan', 'Palau', 'Panama', 'Papua New Guinea', 'Paraguay', 'Peru', 'Philippines', 'Pitcairn', 'Poland', 'Portugal', 'Puerto Rico', 'Qatar', 'Reunion', 'Romania', 'Russia', 'Rwanda', 'Saint Barthélemy', 'Saint Helena', 'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Martin', 'Saint Vincent and the Grenadines', 'Saint-Pierre-et-Miquelon', 'Samoa', 'San Marino', 'Sao Tome and Principe', 'Saudi Arabia', 'Senegal', 'Serbia', 'Serbia and Montenegro', 'Serbia excluding Kosovo', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovak Republic', 'Slovenia', 'Solomon Islands', 'Somalia', 'Somaliland', 'South Africa', 'South Ossetia', 'South Sudan', 'Spain', 'Sri Lanka', 'Sudan', 'Suriname', 'Svalbard', 'Swaziland', 'Sweden', 'Switzerland', 'Syria', 'Taiwan', 'Tajikistan', 'Tanzania', 'Thailand', 'Timor-Leste', 'Togo', 'Tokelau', 'Tonga', 'Transnistria', 'Trinidad and Tobago', 'Tunisia', 'Turkey', 'Turkmenistan', 'Turks and Caicos Islands', 'Tuvalu', 'Uganda', 'Ukraine', 'United Arab Emirates', 'United Kingdom', 'United States', 'Uruguay', 'USSR', 'Uzbekistan', 'Wallis et Futuna', 'Vanuatu', 'Venezuela', 'West Bank and Gaza', 'West Germany', 'Western Sahara', 'Vietnam', 'Virgin Islands (U.S.)', 'Yemen Arab Republic (Former)', 'Yemen Democratic (Former)', 'Yemen, Rep.', 'Yugoslavia', 'Zambia', 'Zimbabwe', 'Åland'])
     with self.assertRaises(FileNotFoundError):
             test1=GlobalIncome('aa')
             test1.loadingData()
     with self.assertRaises(FileNotFoundError):
             test1=GlobalIncome('1')
             test1.loadingData()
 def testGlobalIncome_loadingdata(self):
     self.assertEqual(self.ALLDATA.countries.size, 388)
     self.assertEqual(self.ALLDATA.income.size, 55380)
     self.assertSequenceEqual(list(self.ALLDATA.income.columns), [
         1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810,
         1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821,
         1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832,
         1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843,
         1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854,
         1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865,
         1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876,
         1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887,
         1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898,
         1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909,
         1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920,
         1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931,
         1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942,
         1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953,
         1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964,
         1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975,
         1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986,
         1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
         1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
         2009, 2010, 2011, 2012
     ])
     self.assertSequenceEqual(list(self.ALLDATA.income.index), [
         'Abkhazia', 'Afghanistan', 'Akrotiri and Dhekelia', 'Albania',
         'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla',
         'Antigua and Barbuda', 'Argentina', 'Armenia', 'Aruba',
         'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain',
         'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin',
         'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia and Herzegovina',
         'Botswana', 'Brazil', 'British Virgin Islands', 'Brunei',
         'Bulgaria', 'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon',
         'Canada', 'Cape Verde', 'Cayman Islands', 'Central African Rep.',
         'Chad', 'Channel Islands', 'Chile', 'China', 'Christmas Island',
         'Cocos Island', 'Colombia', 'Comoros', 'Congo, Dem. Rep.',
         'Congo, Rep.', 'Cook Islands', 'Costa Rica', "Cote d'Ivoire",
         'Croatia', 'Cuba', 'Cyprus', 'Czech Rep.', 'Czechoslovakia',
         'Denmark', 'Djibouti', 'Dominica', 'Dominican Rep.',
         'East Germany', 'Ecuador', 'Egypt', 'El Salvador',
         'Equatorial Guinea', 'Eritrea', 'Eritrea and Ethiopia', 'Estonia',
         'Ethiopia', 'Faeroe Islands', 'Falkland Islands (Malvinas)',
         'Fiji', 'Finland', 'France', 'French Guiana', 'French Polynesia',
         'Gabon', 'Gambia', 'Georgia', 'Germany', 'Ghana', 'Gibraltar',
         'Greece', 'Greenland', 'Grenada', 'Guadeloupe', 'Guam',
         'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana',
         'Haiti', 'Holy See', 'Honduras', 'Hong Kong, China', 'Hungary',
         'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Ireland',
         'Isle of Man', 'Israel', 'Italy', 'Jamaica', 'Japan', 'Jersey',
         'Jordan', 'Kazakhstan', 'Kenya', 'Kiribati', 'Korea, Dem. Rep.',
         'Korea, Rep.', 'Korea, United', 'Kosovo', 'Kuwait', 'Kyrgyzstan',
         'Laos', 'Latvia', 'Lebanon', 'Lesotho', 'Liberia', 'Libya',
         'Liechtenstein', 'Lithuania', 'Luxembourg', 'Macao, China',
         'Macedonia, FYR', 'Madagascar', 'Malawi', 'Malaysia', 'Maldives',
         'Mali', 'Malta', 'Marshall Islands', 'Martinique', 'Mauritania',
         'Mauritius', 'Mayotte', 'Mexico', 'Micronesia, Fed. Sts.',
         'Moldova', 'Monaco', 'Mongolia', 'Montenegro', 'Montserrat',
         'Morocco', 'Mozambique', 'Myanmar', 'Nagorno-Karabakh', 'Namibia',
         'Nauru', 'Nepal', 'Netherlands', 'Netherlands Antilles',
         'New Caledonia', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria',
         'Niue', 'Norfolk Island', 'Northern Cyprus',
         'Northern Mariana Islands', 'Norway', 'Oman', 'Pakistan', 'Palau',
         'Panama', 'Papua New Guinea', 'Paraguay', 'Peru', 'Philippines',
         'Pitcairn', 'Poland', 'Portugal', 'Puerto Rico', 'Qatar',
         'Reunion', 'Romania', 'Russia', 'Rwanda', 'Saint Barthélemy',
         'Saint Helena', 'Saint Kitts and Nevis', 'Saint Lucia',
         'Saint Martin', 'Saint Vincent and the Grenadines',
         'Saint-Pierre-et-Miquelon', 'Samoa', 'San Marino',
         'Sao Tome and Principe', 'Saudi Arabia', 'Senegal', 'Serbia',
         'Serbia and Montenegro', 'Serbia excluding Kosovo', 'Seychelles',
         'Sierra Leone', 'Singapore', 'Slovak Republic', 'Slovenia',
         'Solomon Islands', 'Somalia', 'Somaliland', 'South Africa',
         'South Ossetia', 'South Sudan', 'Spain', 'Sri Lanka', 'Sudan',
         'Suriname', 'Svalbard', 'Swaziland', 'Sweden', 'Switzerland',
         'Syria', 'Taiwan', 'Tajikistan', 'Tanzania', 'Thailand',
         'Timor-Leste', 'Togo', 'Tokelau', 'Tonga', 'Transnistria',
         'Trinidad and Tobago', 'Tunisia', 'Turkey', 'Turkmenistan',
         'Turks and Caicos Islands', 'Tuvalu', 'Uganda', 'Ukraine',
         'United Arab Emirates', 'United Kingdom', 'United States',
         'Uruguay', 'USSR', 'Uzbekistan', 'Wallis et Futuna', 'Vanuatu',
         'Venezuela', 'West Bank and Gaza', 'West Germany',
         'Western Sahara', 'Vietnam', 'Virgin Islands (U.S.)',
         'Yemen Arab Republic (Former)', 'Yemen Democratic (Former)',
         'Yemen, Rep.', 'Yugoslavia', 'Zambia', 'Zimbabwe', 'Åland'
     ])
     with self.assertRaises(FileNotFoundError):
         test1 = GlobalIncome('aa')
         test1.loadingData()
     with self.assertRaises(FileNotFoundError):
         test1 = GlobalIncome('1')
         test1.loadingData()
 def setUp(self):
     DataPath=abspath(getsourcefile(lambda:0))
     DataPath=DataPath[:-23]
     self.DataPath=''.join([DataPath,'dataset/'])
     self.ALLDATA = GlobalIncome(self.DataPath)
     self.ALLDATA.loadingData()
 def setUp(self):
     DataPath = abspath(getsourcefile(lambda: 0))
     DataPath = DataPath[:-23]
     self.DataPath = ''.join([DataPath, 'dataset/'])
     self.ALLDATA = GlobalIncome(self.DataPath)
     self.ALLDATA.loadingData()