<commit_before>import os
import subprocess
import unittest


@unittest.skipIf(os.getenv("PYCHARM_HOSTED"), "PYCHARM_HOSTED")
class TestAssetsCoreOS(unittest.TestCase):
    func_path = "%s" % os.path.dirname(__file__)
    tests_path = "%s" % os.path.split(func_path)[0]
    app_path = os.path.split(tests_path)[0]
    project_path = os.path.split(app_path)[0]
    assets_path = "%s/bootcfg/assets" % project_path
    asset_test = "%s/coreos" % assets_path
    default_files = ["Makefile"]

    def test_00_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_01_default(self):
        expect = self.default_files + ["1214.0.0"]
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_02_serve(self):
        expect = self.default_files + ["1214.0.0", "serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "serve"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_03_clean(self):
        expect = self.default_files + ["serve"]
        expect.sort()
        subprocess.check_output(["make", "-C", self.asset_test, "clean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_04_fclean(self):
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(self.default_files, real)


@unittest.skipIf(os.getenv("PYCHARM_HOSTED"), "PYCHARM_HOSTED")
class TestAssetsSetupNetworkEnvironment(unittest.TestCase):
    func_path = "%s" % os.path.dirname(__file__)
    tests_path = os.path.split(func_path)[0]
    app_path = os.path.split(tests_path)[0]
    project_path = os.path.split(app_path)[0]
    assets_path = "%s/bootcfg/assets" % project_path
    asset_test = "%s/setup-network-environment" % assets_path
    default_files = ["Makefile", "1.0.1-setup-network-environment.sha512"]

    def test_00_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_01_default(self):
        expect = self.default_files + ["1.0.1"]
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_02_serve(self):
        expect = self.default_files + ["1.0.1", "serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "serve"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_03_clean(self):
        expect = self.default_files + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "clean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_04_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)


@unittest.skipIf(os.getenv("PYCHARM_HOSTED"), "PYCHARM_HOSTED")
class TestAssetsRkt(unittest.TestCase):
    func_path = "%s" % os.path.dirname(__file__)
    tests_path = os.path.split(func_path)[0]
    app_path = os.path.split(tests_path)[0]
    project_path = os.path.split(app_path)[0]
    assets_path = "%s/bootcfg/assets" % project_path
    asset_test = "%s/rkt" % assets_path
    default_files = ["Makefile"]

    def test_00_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_01_default(self):
        expect = self.default_files + ["v1.19.0"]
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_02_serve(self):
        expect = self.default_files + ["v1.19.0", "serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "serve"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_03_clean(self):
        expect = self.default_files + ["v1.19.0", "serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "clean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_04_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)


@unittest.skipIf(os.getenv("PYCHARM_HOSTED"), "PYCHARM_HOSTED")
class TestAssetsDiscoveryC(unittest.TestCase):
    func_path = "%s" % os.path.dirname(__file__)
    tests_path = os.path.split(func_path)[0]
    app_path = os.path.split(tests_path)[0]
    project_path = os.path.split(app_path)[0]
    assets_path = "%s/bootcfg/assets" % project_path
    asset_test = "%s/discoveryC" % assets_path
    default_files = ["Makefile"]

    def test_00_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_01_default(self):
        expect = self.default_files + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_02_static(self):
        f = "%s/serve/discoveryC" % self.asset_test
        self.assertTrue(os.path.isfile(f))
        ret = subprocess.call(["ldd", f])
        self.assertEqual(ret, 1)

    def test_03_clean(self):
        expect = self.default_files + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "clean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_04_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)<commit_msg>The assets tests re-do everything<commit_after>import os
import subprocess
import unittest


@unittest.skipIf(os.getenv("PYCHARM_HOSTED"), "PYCHARM_HOSTED")
class TestAssetsCoreOS(unittest.TestCase):
    func_path = "%s" % os.path.dirname(__file__)
    tests_path = "%s" % os.path.split(func_path)[0]
    app_path = os.path.split(tests_path)[0]
    project_path = os.path.split(app_path)[0]
    assets_path = "%s/bootcfg/assets" % project_path
    asset_test = "%s/coreos" % assets_path
    default_files = ["Makefile"]
    version = default_files + ["1214.0.0"]

    def test_00_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_01_default(self):
        expect = self.version
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_02_serve(self):
        expect = self.version + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "serve"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_03_clean(self):
        expect = self.default_files + ["serve"]
        expect.sort()
        subprocess.check_output(["make", "-C", self.asset_test, "clean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_04_fclean(self):
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(self.default_files, real)

    def test_05_default(self):
        expect = self.version
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_06_serve(self):
        expect = self.version + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "serve"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)


@unittest.skipIf(os.getenv("PYCHARM_HOSTED"), "PYCHARM_HOSTED")
class TestAssetsSetupNetworkEnvironment(unittest.TestCase):
    func_path = "%s" % os.path.dirname(__file__)
    tests_path = os.path.split(func_path)[0]
    app_path = os.path.split(tests_path)[0]
    project_path = os.path.split(app_path)[0]
    assets_path = "%s/bootcfg/assets" % project_path
    asset_test = "%s/setup-network-environment" % assets_path
    default_files = ["Makefile", "1.0.1-setup-network-environment.sha512"]
    version = default_files + ["1.0.1"]

    def test_00_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_01_default(self):
        expect = self.version
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_02_serve(self):
        expect = self.version + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "serve"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_03_clean(self):
        expect = self.default_files + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "clean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_04_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_05_default(self):
        expect = self.version
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_06_serve(self):
        expect = self.version + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "serve"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)


@unittest.skipIf(os.getenv("PYCHARM_HOSTED"), "PYCHARM_HOSTED")
class TestAssetsRkt(unittest.TestCase):
    func_path = "%s" % os.path.dirname(__file__)
    tests_path = os.path.split(func_path)[0]
    app_path = os.path.split(tests_path)[0]
    project_path = os.path.split(app_path)[0]
    assets_path = "%s/bootcfg/assets" % project_path
    asset_test = "%s/rkt" % assets_path
    default_files = ["Makefile"]
    version = default_files + ["v1.19.0"]

    def test_00_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_01_default(self):
        expect = self.version
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_02_serve(self):
        expect = self.version + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "serve"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_03_clean(self):
        expect = self.version + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "clean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_04_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_05_default(self):
        expect = self.version
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_06_serve(self):
        expect = self.version + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "serve"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)


@unittest.skipIf(os.getenv("PYCHARM_HOSTED"), "PYCHARM_HOSTED")
class TestAssetsDiscoveryC(unittest.TestCase):
    func_path = "%s" % os.path.dirname(__file__)
    tests_path = os.path.split(func_path)[0]
    app_path = os.path.split(tests_path)[0]
    project_path = os.path.split(app_path)[0]
    assets_path = "%s/bootcfg/assets" % project_path
    asset_test = "%s/discoveryC" % assets_path
    default_files = ["Makefile"]

    def test_00_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_01_default(self):
        expect = self.default_files + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_02_static(self):
        f = "%s/serve/discoveryC" % self.asset_test
        self.assertTrue(os.path.isfile(f))
        ret = subprocess.call(["ldd", f])
        self.assertEqual(ret, 1)

    def test_03_clean(self):
        expect = self.default_files + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test, "clean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_04_fclean(self):
        expect = self.default_files
        subprocess.check_output(["make", "-C", self.asset_test, "fclean"])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_05_default(self):
        expect = self.default_files + ["serve"]
        subprocess.check_output(["make", "-C", self.asset_test])
        real = os.listdir(self.asset_test)
        self.assertItemsEqual(expect, real)

    def test_06_static(self):
        f = "%s/serve/discoveryC" % self.asset_test
        self.assertTrue(os.path.isfile(f))
        ret = subprocess.call(["ldd", f])
        self.assertEqual(ret, 1)
{'fraction_non_alphanumeric': 0.14316512834332681, 'fraction_numerical': 0.011992184868288082, 'mean_word_length': 3.231470923603193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2632549', 'n_tokens_mistral': 5041, 'n_tokens_neox': 4916, 'n_words': 782}