From a6c92457f55ede04725ccd4688f8b3644499b686 Mon Sep 17 00:00:00 2001 From: francisco Date: Mon, 26 Feb 2018 14:37:11 -0300 Subject: [PATCH 01/19] change array identation --- roman_to_decimal.py | 5 ++--- romandecimalroman.py | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/roman_to_decimal.py b/roman_to_decimal.py index 90e1690..cd0aab5 100644 --- a/roman_to_decimal.py +++ b/roman_to_decimal.py @@ -4,7 +4,8 @@ def decimal(roman): cadena = list(roman) result = 0 count = 0 - a = ['A', 'B', 'E', 'F', 'G', 'H', 'J', 'K', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'W', 'Y', 'Z'] + a = ['A', 'B', 'E', 'F', 'G', 'H', 'J', 'K', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'W', 'Y', 'Z'] if any(x in roman for x in a): result = 'Input is not a roman number' else: @@ -21,5 +22,3 @@ def decimal(roman): result += roma[letra] count += 1 return result - - diff --git a/romandecimalroman.py b/romandecimalroman.py index 663961d..79d95e2 100644 --- a/romandecimalroman.py +++ b/romandecimalroman.py @@ -2,4 +2,7 @@ from Roman import roman def roman_to_roman(romano): - return roman(decimal(romano)) \ No newline at end of file + return roman(decimal(romano)) + + + From 2f032427bbc1325c23eeb0b2113403ae1bad4b7e Mon Sep 17 00:00:00 2001 From: Fernando Mez Date: Mon, 26 Feb 2018 14:38:35 -0300 Subject: [PATCH 02/19] Fixed whitespace around arithmetic operation file roman_to_number line 13 --- roman_to_decimal.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/roman_to_decimal.py b/roman_to_decimal.py index 90e1690..876337f 100644 --- a/roman_to_decimal.py +++ b/roman_to_decimal.py @@ -1,4 +1,3 @@ - def decimal(roman): roma = {'M': 1000, 'D': 500, 'C': 100, 'L': 50, 'X': 10, 'V': 5, 'I': 1} cadena = list(roman) @@ -11,7 +10,7 @@ def decimal(roman): for letra in cadena: if len(cadena) != count + 1: if len(cadena) > 0: - if roma[letra] < roma[cadena[count+1]]: + if roma[letra] < roma[cadena[count + 1]]: result -= roma[letra] else: result += roma[letra] @@ -21,5 +20,3 @@ def decimal(roman): result += roma[letra] count += 1 return result - - From 16d87758d21ca74f2c86fdf65de0ad2939b5202a Mon Sep 17 00:00:00 2001 From: asaiz Date: Mon, 26 Feb 2018 14:39:24 -0300 Subject: [PATCH 03/19] eliminar dos espacios en blanco del diccionario --- Roman.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Roman.py b/Roman.py index 89965be..ad81f0a 100644 --- a/Roman.py +++ b/Roman.py @@ -7,8 +7,6 @@ def roman(numero): if not isinstance(numero, int): return "Only int numbers" - - numeros = { 1000 :'M', 900 :'CM', From 3aff876db6c8cc76614da0fab81adc79121128e9 Mon Sep 17 00:00:00 2001 From: danteC94 Date: Mon, 26 Feb 2018 14:39:44 -0300 Subject: [PATCH 04/19] primer linea arreglada --- Roman.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Roman.py b/Roman.py index 89965be..ad81f0a 100644 --- a/Roman.py +++ b/Roman.py @@ -7,8 +7,6 @@ def roman(numero): if not isinstance(numero, int): return "Only int numbers" - - numeros = { 1000 :'M', 900 :'CM', From 73f87fac660f0c541ac767dd0605b4c4e5441673 Mon Sep 17 00:00:00 2001 From: PKpacheco Date: Mon, 26 Feb 2018 14:45:32 -0300 Subject: [PATCH 05/19] add line 18 --- test_suite.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test_suite.py b/test_suite.py index 1950cc9..d59f042 100644 --- a/test_suite.py +++ b/test_suite.py @@ -15,6 +15,7 @@ def suite(): test_suite.addTest(unittest.makeSuite(TestRoman)) return test_suite + if __name__ == "__main__": #So you can run tests from this module individually. unittest.main() \ No newline at end of file From 6e9a156585f6a7875e4d94461053e1a7955f8ad4 Mon Sep 17 00:00:00 2001 From: Fernando Mez Date: Mon, 26 Feb 2018 14:45:22 -0300 Subject: [PATCH 06/19] Fixed whitespace line 41 test_roman.py --- test_roman.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test_roman.py b/test_roman.py index 63617ef..fec183d 100644 --- a/test_roman.py +++ b/test_roman.py @@ -19,7 +19,7 @@ def test_roman_decimal_roman_two(self): def test_roman_decimal_roman_four(self): resultado = roman(4) self.assertEqual(resultado, 'IV') - + def test_roman_decimal_roman_ten(self): resultado = roman(10) self.assertEqual(resultado, 'X') @@ -30,7 +30,7 @@ def test_roman_decimal_roman_five(self): def test_roman_decimal_roman_845(self): resultado = roman(845) - self.assertEqual(resultado, 'DCCCXLV') + self.assertEqual(resultado, 'DCCCXLV') def test_roman_decimal_roman_minor(self): resultado = roman(-1) @@ -38,14 +38,14 @@ def test_roman_decimal_roman_minor(self): def test_roman_decimal_roman_not_type(self): resultado = roman(10.5) - self.assertEqual(resultado, "Only int numbers") + self.assertEqual(resultado, "Only int numbers") def test_romandecimal_one(self): self.assertEqual(decimal('I'), 1) def test_romandecimal_two(self): self.assertEqual(decimal('II'), 2) - + def test_romandecimal_three(self): self.assertEqual(decimal('III'), 3) @@ -70,10 +70,10 @@ def test_roman_decimal_3999(self): def test_roman_decimal_4000(self): resultado = roman(4000) - self.assertEqual(resultado, 'Not a valid number') + self.assertEqual(resultado, 'Not a valid number') ## definir primer test - + class Roman_to_decimal_to_roman(unittest.TestCase): def test_I(self): self.assertEqual(roman_to_roman('I'),'I') From 62feb85447aa8d92148de69937f980d5b61aa798 Mon Sep 17 00:00:00 2001 From: PKpacheco Date: Mon, 26 Feb 2018 14:47:53 -0300 Subject: [PATCH 07/19] add line 8 --- test_suite.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test_suite.py b/test_suite.py index 1950cc9..b220ffc 100644 --- a/test_suite.py +++ b/test_suite.py @@ -5,6 +5,7 @@ ) from test_roman import TestRoman + def suite(): """ Gather all the tests from this module in a test suite. From 0f03098b3946c90b686778cc069857acefefd849 Mon Sep 17 00:00:00 2001 From: asaiz Date: Mon, 26 Feb 2018 14:48:08 -0300 Subject: [PATCH 08/19] Se arreglo el dos puntos del caracter M --- Roman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Roman.py b/Roman.py index ad81f0a..f7ac048 100644 --- a/Roman.py +++ b/Roman.py @@ -8,7 +8,7 @@ def roman(numero): if not isinstance(numero, int): return "Only int numbers" numeros = { - 1000 :'M', + 1000: 'M', 900 :'CM', 500 :'D', 400 :'CD', From 3873f79aaf58276b5ea273aa29223a3ea32a0509 Mon Sep 17 00:00:00 2001 From: francisco Date: Mon, 26 Feb 2018 14:48:35 -0300 Subject: [PATCH 09/19] mend change ident array --- roman_to_decimal.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/roman_to_decimal.py b/roman_to_decimal.py index cd0aab5..d449b1e 100644 --- a/roman_to_decimal.py +++ b/roman_to_decimal.py @@ -4,8 +4,27 @@ def decimal(roman): cadena = list(roman) result = 0 count = 0 - a = ['A', 'B', 'E', 'F', 'G', 'H', 'J', 'K', 'N', - 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'W', 'Y', 'Z'] + a = [ + 'A', + 'B', + 'E', + 'F', + 'G', + 'H', + 'J', + 'K', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'W', + 'Y', + 'Z', + ] if any(x in roman for x in a): result = 'Input is not a roman number' else: From 7f041fdfcb172a61c07b1c14e615726de1f20767 Mon Sep 17 00:00:00 2001 From: Fernando Mez Date: Mon, 26 Feb 2018 14:45:22 -0300 Subject: [PATCH 10/19] Fixed whitespace line 41 test_roman.py --- test_roman.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test_roman.py b/test_roman.py index 63617ef..fec183d 100644 --- a/test_roman.py +++ b/test_roman.py @@ -19,7 +19,7 @@ def test_roman_decimal_roman_two(self): def test_roman_decimal_roman_four(self): resultado = roman(4) self.assertEqual(resultado, 'IV') - + def test_roman_decimal_roman_ten(self): resultado = roman(10) self.assertEqual(resultado, 'X') @@ -30,7 +30,7 @@ def test_roman_decimal_roman_five(self): def test_roman_decimal_roman_845(self): resultado = roman(845) - self.assertEqual(resultado, 'DCCCXLV') + self.assertEqual(resultado, 'DCCCXLV') def test_roman_decimal_roman_minor(self): resultado = roman(-1) @@ -38,14 +38,14 @@ def test_roman_decimal_roman_minor(self): def test_roman_decimal_roman_not_type(self): resultado = roman(10.5) - self.assertEqual(resultado, "Only int numbers") + self.assertEqual(resultado, "Only int numbers") def test_romandecimal_one(self): self.assertEqual(decimal('I'), 1) def test_romandecimal_two(self): self.assertEqual(decimal('II'), 2) - + def test_romandecimal_three(self): self.assertEqual(decimal('III'), 3) @@ -70,10 +70,10 @@ def test_roman_decimal_3999(self): def test_roman_decimal_4000(self): resultado = roman(4000) - self.assertEqual(resultado, 'Not a valid number') + self.assertEqual(resultado, 'Not a valid number') ## definir primer test - + class Roman_to_decimal_to_roman(unittest.TestCase): def test_I(self): self.assertEqual(roman_to_roman('I'),'I') From 95d522aed370d725588c8fe4fe6da3cf23b825f5 Mon Sep 17 00:00:00 2001 From: Fernando Mez Date: Mon, 26 Feb 2018 14:49:23 -0300 Subject: [PATCH 11/19] Fixed line too long test_roman_to_int line 32 --- test_roman_to_int.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test_roman_to_int.py b/test_roman_to_int.py index 3137199..b5e0e17 100644 --- a/test_roman_to_int.py +++ b/test_roman_to_int.py @@ -12,7 +12,7 @@ def test_romandecimal_one(self): def test_romandecimal_two(self): self.assertEqual(decimal('II'), 2) - + def test_romandecimal_three(self): self.assertEqual(decimal('III'), 3) @@ -29,10 +29,13 @@ def test_romandecimal_3999(self): self.assertEqual(decimal('MMMCMXCIX'), 3999) def test_wrong_letter(self): - self.assertEqual(decimal('CCXASDASHDUASBD'), 'Input is not a roman number') + self.assertEqual( + decimal('CCXASDASHDUASBD'), + 'Input is not a roman number' + ) ## definir primer test - + class Roman_to_decimal_to_roman(unittest.TestCase): def test_all(self): for number in xrange(1, 4): From 71efccc60a204fca6062e499978174b5fd435388 Mon Sep 17 00:00:00 2001 From: asaiz Date: Mon, 26 Feb 2018 14:54:17 -0300 Subject: [PATCH 12/19] 900 --- Roman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Roman.py b/Roman.py index f7ac048..8fdd224 100644 --- a/Roman.py +++ b/Roman.py @@ -9,7 +9,7 @@ def roman(numero): return "Only int numbers" numeros = { 1000: 'M', - 900 :'CM', + 900: 'CM', 500 :'D', 400 :'CD', 100 :'C', From 1d94f5a3930fe502a86a2c3b62481bc2f72468fb Mon Sep 17 00:00:00 2001 From: Fernando Mez Date: Mon, 26 Feb 2018 14:49:23 -0300 Subject: [PATCH 13/19] Fixed line too long test_roman_to_int line 32 --- test_roman_to_int.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test_roman_to_int.py b/test_roman_to_int.py index 3137199..b5e0e17 100644 --- a/test_roman_to_int.py +++ b/test_roman_to_int.py @@ -12,7 +12,7 @@ def test_romandecimal_one(self): def test_romandecimal_two(self): self.assertEqual(decimal('II'), 2) - + def test_romandecimal_three(self): self.assertEqual(decimal('III'), 3) @@ -29,10 +29,13 @@ def test_romandecimal_3999(self): self.assertEqual(decimal('MMMCMXCIX'), 3999) def test_wrong_letter(self): - self.assertEqual(decimal('CCXASDASHDUASBD'), 'Input is not a roman number') + self.assertEqual( + decimal('CCXASDASHDUASBD'), + 'Input is not a roman number' + ) ## definir primer test - + class Roman_to_decimal_to_roman(unittest.TestCase): def test_all(self): for number in xrange(1, 4): From c2e52dead1fb3e5960c1682fa5515ac309daff4b Mon Sep 17 00:00:00 2001 From: Fernando Mez Date: Mon, 26 Feb 2018 14:56:09 -0300 Subject: [PATCH 14/19] Added EOF line to test_suite.py --- test_suite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_suite.py b/test_suite.py index f5785ca..a1d63bf 100644 --- a/test_suite.py +++ b/test_suite.py @@ -19,4 +19,4 @@ def suite(): if __name__ == "__main__": #So you can run tests from this module individually. - unittest.main() \ No newline at end of file + unittest.main() From 43454a1f5be08310d518b2b1264b4caf60b7f8d8 Mon Sep 17 00:00:00 2001 From: asaiz Date: Mon, 26 Feb 2018 14:57:00 -0300 Subject: [PATCH 15/19] spaces500 --- Roman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Roman.py b/Roman.py index 8fdd224..601b303 100644 --- a/Roman.py +++ b/Roman.py @@ -10,7 +10,7 @@ def roman(numero): numeros = { 1000: 'M', 900: 'CM', - 500 :'D', + 500: 'D', 400 :'CD', 100 :'C', 90 : 'XC', From bcbf379a0d2e95ee36584e6161ea4a8a5f5c0711 Mon Sep 17 00:00:00 2001 From: manu Date: Mon, 26 Feb 2018 14:48:50 -0300 Subject: [PATCH 16/19] modify Romany.py --- Roman.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/Roman.py b/Roman.py index 601b303..6505ac1 100644 --- a/Roman.py +++ b/Roman.py @@ -7,21 +7,12 @@ def roman(numero): if not isinstance(numero, int): return "Only int numbers" + numeros = { - 1000: 'M', - 900: 'CM', - 500: 'D', - 400 :'CD', - 100 :'C', - 90 : 'XC', - 50 : 'L', - 40 : 'XL', - 10: 'X', - 9 : 'IX', - 5 : 'V', - 4 : 'IV', - 1 : 'I', + 1000: 'M', 900: 'CM', 500: 'D', 400: 'CD', 100: 'C', 90: 'XC', 50: 'L', + 40: 'XL', 10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I', } + roman = '' for key in sorted(numeros.keys(), reverse=True): @@ -30,4 +21,4 @@ def roman(numero): cant = numero // key roman += value * cant numero -= cant * key - return roman \ No newline at end of file + return roman From b173c448403ade05a4e907ec93ee0c4572f23c63 Mon Sep 17 00:00:00 2001 From: Gabriel Flores Date: Mon, 26 Feb 2018 16:25:25 -0300 Subject: [PATCH 17/19] add testing coverage --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d5635e6..7202256 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # Roman-numbers [![Build Status](https://travis-ci.org/evbeda/Roman-numbers.svg?branch=master)](https://travis-ci.org/evbeda/Roman-numbers) + +[![Coverage Status](https://coveralls.io/repos/github/evbeda/Roman-numbers/badge.svg?branch=master)](https://coveralls.io/github/evbeda/Roman-numbers?branch=master) From 8057380a388d4ec0bdc0c04327e90513314a061f Mon Sep 17 00:00:00 2001 From: Gabriel Flores Date: Mon, 26 Feb 2018 17:21:03 -0300 Subject: [PATCH 18/19] support coverage --- .travis.yml | 7 ++++++- requirements.txt | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 requirements.txt diff --git a/.travis.yml b/.travis.yml index 2e78c5a..b3f857a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,9 @@ language: python python: - "2.7" -script: python test_suite.py +install: + - pip install -r requirements.txt +script: coverage run test_suite.py + +after_success: +- coveralls \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5ecbbc9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +coverage==4.5.1 +wheel==0.24.0 From eb7f55ac35efe6961e5447411a32435cba26fc41 Mon Sep 17 00:00:00 2001 From: Gabriel Flores Date: Mon, 26 Feb 2018 20:16:06 -0300 Subject: [PATCH 19/19] fix support coverage --- requirements.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 5ecbbc9..050b152 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,9 @@ -coverage==4.5.1 -wheel==0.24.0 +certifi==2018.1.18 +chardet==3.0.4 +coverage==4.0.3 +idna==2.6 +python-coveralls==2.9.1 +PyYAML==3.12 +requests==2.18.4 +six==1.11.0 +urllib3==1.22