コード例 #1
0
ファイル: run_tests.py プロジェクト: purposelycryptic/Caper
    tests = CaperTests(debug=arguments['logging_mode'] == 'debug')

    parser_type = arguments['parser_type'] or \
        raw_input_default('Parser type (scene, anime) [scene]: ', 'scene')

    test_file = ''
    test_file_default = 'scene.csv'
    if os.path.isfile(parser_type + '.csv'):
        test_file_default = parser_type + '.csv'

    while test_file == '':
        test_file = arguments['test_file'] or \
            raw_input_default('Test file [%s]: ' % test_file_default, test_file_default)

        if not os.path.isfile(test_file):
            test_file = ''
            print "ERROR: Test file does not exist"
            print

    logging_mode = arguments['logging_mode'] or \
        raw_input_default('Logging mode (debug, info) [info]: ', 'info')

    if logging_mode == 'debug':
        Logr.configure(logging.DEBUG, trace_origin=True)
    else:
        Logr.configure(logging.INFO)

    tests.load(test_file, 100)

    tests.run(parser_type, arguments)
コード例 #2
0
 def setUp(self):
     Logr.configure(logging.DEBUG)
     self.merge = MergeTransformer()
コード例 #3
0
    def setUp(self):
        Logr.configure(logging.DEBUG)

        self.qc = QueryCondenser()
コード例 #4
0
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from helpers import setup_path
setup_path()

import logging
from logr import Logr
Logr.configure(logging.DEBUG)

from caper import Caper
from matchers import has_info
from hamcrest import *

caper = Caper()


def test_resolution():
    assert_that(caper.parse('Show Name.S01E05.720p-GROUP'),
                has_info('video', {'resolution': '720p'}))

    assert_that(caper.parse('Show Name.S01E05.1080p'),
                has_info('video', {'resolution': '1080p'}))
コード例 #5
0
ファイル: test_scene_parser.py プロジェクト: fuzeman/Caper
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from helpers import setup_path
setup_path()

import logging
from logr import Logr
Logr.configure(logging.DEBUG)

from caper import Caper
from caper.parsers.scene import SceneParser
from matchers import has_info
from hamcrest import *

caper = Caper()


def test_closures():
    r = caper.parse('Show Name.S01E05.[720p]-GROUP')
    assert_that(r, has_info('video', {'resolution': '720p'}))
    assert_that(r, has_info('group', 'GROUP'))

コード例 #6
0
 def setUp(self):
     Logr.configure(logging.DEBUG)