summaryrefslogtreecommitdiffstats
path: root/python/mozbuild/mozbuild/test/test_licenses.py
blob: 9f3f12d42300b42a6e79d3e16c80f86c2467468e (plain)
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
import unittest

import mozunit

from mozbuild.vendor.vendor_rust import VendorRust


class TestLicenses(unittest.TestCase):
    """
    Unit tests for the Rust Vendoring stuff
    """

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def testLicense(self):
        self.assertEqual(VendorRust.runtime_license("", "Apache-2.0"), True)
        self.assertEqual(VendorRust.runtime_license("", "MIT"), True)
        self.assertEqual(VendorRust.runtime_license("", "GPL"), False)
        self.assertEqual(VendorRust.runtime_license("", "MIT /GPL"), True)
        self.assertEqual(VendorRust.runtime_license("", "GPL/ Proprietary"), False)
        self.assertEqual(VendorRust.runtime_license("", "GPL AND MIT"), False)
        self.assertEqual(VendorRust.runtime_license("", "ISC\tAND\tMIT"), False)
        self.assertEqual(VendorRust.runtime_license("", "GPL OR MIT"), True)
        self.assertEqual(VendorRust.runtime_license("", "ALLIGATOR MIT"), False)
        pass


if __name__ == "__main__":
    mozunit.main()