<commit_before>#!/usr/bin/python

from __future__ import print_function
import unittest
import os
import sys
sys.path.append('/vagrant/cli')
from utils import Utils
from appConfig import AppConfig

#Test basic functionalities of Settings class
class TestUtils(unittest.TestCase):

  def setUp(self):
    self.utils = Utils()
    self.appConfig = AppConfig()

  def test_extractFullShaAndVersion(self):
    assert self.utils.extractFullShaAndVersion("testproject-testapp-26363727sha232/v0.46") == "26363727sha232/v0.46"
    assert self.utils.extractFullShaAndVersion("") == ""
    assert self.utils.extractFullShaAndVersion("bdsbddadhhd") == ""

  def test_extractShaFromImage(self):
    #assert self.utils.extractShaFromImage("moz-content-kairos-7da406eb9e8937875e0548ae1149/v0.46") == "7da406eb9e8937875e0548ae1149"
    assert self.utils.extractShaFromImage("testproject-testapp-779824982sha123/v0.46") == "779824982sha123"
    assert self.utils.extractShaFromImage("") == ""
    assert self.utils.extractShaFromImage("bdsbddadhhd") == ""

  def tearDown(self):
    pass

if __name__ == '__main__':
  unittest.main()<commit_msg>ROGER-823:[CLI] Cleanup/remove moz specific details from roger-mesos-tools<commit_after>#!/usr/bin/python

from __future__ import print_function
import unittest
import os
import sys
sys.path.append('/vagrant/cli')
from utils import Utils
from appConfig import AppConfig

#Test basic functionalities of Settings class
class TestUtils(unittest.TestCase):

  def setUp(self):
    self.utils = Utils()
    self.appConfig = AppConfig()

  def test_extractFullShaAndVersion(self):
    assert self.utils.extractFullShaAndVersion("testproject-testapp-26363727sha232/v0.46") == "26363727sha232/v0.46"
    assert self.utils.extractFullShaAndVersion("") == ""
    assert self.utils.extractFullShaAndVersion("bdsbddadhhd") == ""

  def test_extractShaFromImage(self):
    assert self.utils.extractShaFromImage("testproject-testapp-779824982sha123/v0.46") == "779824982sha123"
    assert self.utils.extractShaFromImage("") == ""
    assert self.utils.extractShaFromImage("bdsbddadhhd") == ""

  def tearDown(self):
    pass

if __name__ == '__main__':
  unittest.main()
{'fraction_non_alphanumeric': 0.1194508009153318, 'fraction_numerical': 0.07139588100686499, 'mean_word_length': 5.429411764705883, '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': '4781926', 'n_tokens_mistral': 839, 'n_tokens_neox': 750, 'n_words': 126}