File: Disable-CLI-tests-as-we-don-t-have-python3-delegator-in-D.patch

package info (click to toggle)
python-num2words 0.5.10-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 956 kB
  • sloc: python: 11,457; makefile: 3
file content (134 lines) | stat: -rw-r--r-- 4,544 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
From: =?utf-8?q?Rapha=C3=ABl_Hertzog?= <raphael@freexian.com>
Date: Tue, 19 Jan 2021 16:26:29 +0100
Subject: Disable CLI tests as we don't have python3-delegator in Debian

---
 setup.py          |   1 -
 tests/test_cli.py | 111 ------------------------------------------------------
 2 files changed, 112 deletions(-)
 delete mode 100644 tests/test_cli.py

--- a/tests/test_cli.py
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-# Copyright (c) 2003, Taro Ogawa.  All Rights Reserved.
-# Copyright (c) 2013, Savoir-faire Linux inc.  All Rights Reserved.
-
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301 USA
-
-from __future__ import unicode_literals
-
-import os
-import unittest
-
-import delegator
-
-import num2words
-
-
-class CliCaller(object):
-
-    def __init__(self):
-        self.cmd = os.path.realpath(os.path.join(os.path.dirname(__file__),
-                                    "..", "bin", "num2words"))
-        self.cmd_list = ["python", self.cmd]
-
-    def run_cmd(self, *args):
-        cmd_list = self.cmd_list + [str(arg) for arg in args]
-        cmd = " ".join(cmd_list)
-        return delegator.run(cmd)
-
-
-class CliTestCase(unittest.TestCase):
-    """Test the command line app"""
-
-    def setUp(self):
-        self.cli = CliCaller()
-
-    def test_cli_help(self):
-        """num2words without arguments should exit with status 1
-        and show docopt's default short usage message
-        """
-        output = self.cli.run_cmd()
-        self.assertEqual(output.return_code, 1)
-        self.assertTrue(output.err.startswith('Usage:'))
-
-    def test_cli_list_langs(self):
-        """You should be able to list all availabe languages
-        """
-        output = self.cli.run_cmd('--list-languages')
-        self.assertEqual(
-            sorted(list(num2words.CONVERTER_CLASSES.keys())),
-            output.out.strip().split(os.linesep)
-        )
-        output = self.cli.run_cmd('-L')
-        self.assertEqual(
-            sorted(list(num2words.CONVERTER_CLASSES.keys())),
-            output.out.strip().split(os.linesep)
-        )
-
-    def test_cli_list_converters(self):
-        """You should be able to list all available converters
-        """
-        output = self.cli.run_cmd('--list-converters')
-        self.assertEqual(
-            sorted(list(num2words.CONVERTES_TYPES)),
-            output.out.strip().split(os.linesep)
-        )
-        output = self.cli.run_cmd('-C')
-        self.assertEqual(
-            sorted(list(num2words.CONVERTES_TYPES)),
-            output.out.strip().split(os.linesep)
-        )
-
-    def test_cli_default_lang(self):
-        """Default to english
-        """
-        output = self.cli.run_cmd(150)
-        self.assertEqual(output.return_code, 0)
-        self.assertEqual(
-            output.out.strip(),
-            "one hundred and fifty"
-        )
-
-    def test_cli_with_lang(self):
-        """You should be able to specify a language
-        """
-        output = self.cli.run_cmd(150, '--lang', 'es')
-        self.assertEqual(output.return_code, 0)
-        self.assertEqual(
-            output.out.strip(),
-            "ciento cincuenta"
-        )
-
-    def test_cli_with_lang_to(self):
-        """You should be able to specify a language
-        """
-        output = self.cli.run_cmd(150.55, '--lang', 'es', '--to', 'currency')
-        self.assertEqual(output.return_code, 0)
-        self.assertEqual(
-            (output.out.decode('utf-8') if hasattr(output.out, 'decode') else
-             output.out).strip(),
-            "ciento cincuenta euros con cincuenta y cinco céntimos"
-        )
--- a/setup.py
+++ b/setup.py
@@ -75,5 +75,4 @@
     classifiers=CLASSIFIERS,
     scripts=['bin/num2words'],
     install_requires=["docopt>=0.6.2"],
-    tests_require=['delegator.py'],
 )