-
-
Notifications
You must be signed in to change notification settings - Fork 510
/
Copy pathtest_package.py
39 lines (32 loc) · 1.45 KB
/
test_package.py
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
# -*- coding: utf-8 -*-
"""
Test Sage Package Handling
"""
# ****************************************************************************
# Copyright (C) 2015 Volker Braun <vbraun.name@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************
import unittest
from sage_bootstrap.package import Package
from sage_bootstrap.tarball import Tarball
class PackageTestCase(unittest.TestCase):
maxDiff = None
def test_package(self):
pkg = Package('pari')
self.assertTrue(pkg.name, 'pari')
self.assertTrue(pkg.path.endswith('build/pkgs/pari'))
self.assertEqual(pkg.tarball_pattern, 'pari-VERSION.tar.gz')
self.assertEqual(pkg.tarball_filename, pkg.tarball.filename)
self.assertTrue(pkg.tarball.filename.startswith('pari-') and
pkg.tarball.filename.endswith('.tar.gz'))
self.assertTrue(pkg.tarball.filename.startswith('pari-') and
pkg.tarball.filename.endswith('.tar.gz'))
self.assertTrue(isinstance(pkg.tarball, Tarball))
def test_all(self):
pari = Package('pari')
self.assertTrue(pari in Package.all())