Пример #1
0
 def test_parse_yotta_search_cmd_output_new_style(self):
     self.assertIn(
         "frdm-k64f-gcc",
         mbed_target_info.parse_yotta_search_cmd_output(
             "frdm-k64f-gcc 0.1.4"))
     self.assertIn(
         "frdm-k64f-armcc",
         mbed_target_info.parse_yotta_search_cmd_output(
             "frdm-k64f-armcc 0.1.4"))
     pass
Пример #2
0
 def test_parse_yotta_search_cmd_output_with_ssl_errors(self):
     result = []
     for line in self.YOTTA_SEARCH_SSL_ISSUE.splitlines():
         yotta_target_name = mbed_target_info.parse_yotta_search_cmd_output(line)
         if yotta_target_name:
             result.append(yotta_target_name)
     self.assertIn("frdm-k64f-gcc", result)
     self.assertIn("frdm-k64f-armcc", result)
     self.assertEqual(2, len(result))
Пример #3
0
 def test_parse_yotta_search_cmd_output(self):
     self.assertIn(
         "frdm-k64f-gcc",
         mbed_target_info.parse_yotta_search_cmd_output(
             "frdm-k64f-gcc 0.0.24: Official mbed build target for the mbed frdm-k64f development board."
         ))
     self.assertIn(
         "frdm-k64f-armcc",
         mbed_target_info.parse_yotta_search_cmd_output(
             "frdm-k64f-armcc 0.0.16: Official mbed build target for the mbed frdm-k64f development board, using the armcc toolchain."
         ))
     self.assertEqual(None,
                      mbed_target_info.parse_yotta_search_cmd_output(""))
     self.assertEqual(
         None,
         mbed_target_info.parse_yotta_search_cmd_output(
             "additional results from https://yotta-private.herokuapp.com:")
     )
Пример #4
0
 def test_parse_yotta_search_cmd_output(self):
     self.assertIn(
         "frdm-k64f-gcc",
         mbed_target_info.parse_yotta_search_cmd_output(
             "frdm-k64f-gcc 0.0.24: Official mbed build target for the mbed frdm-k64f development board."
         ),
     )
     self.assertIn(
         "frdm-k64f-armcc",
         mbed_target_info.parse_yotta_search_cmd_output(
             "frdm-k64f-armcc 0.0.16: Official mbed build target for the mbed frdm-k64f development board, using the armcc toolchain."
         ),
     )
     self.assertEqual(None, mbed_target_info.parse_yotta_search_cmd_output(""))
     self.assertEqual(
         None,
         mbed_target_info.parse_yotta_search_cmd_output(
             "additional results from https://yotta-private.herokuapp.com:"
         ),
     )
Пример #5
0
    def test_parse_yotta_search_cmd_output_text(self):
        # Old style with new switch --short : 'yotta search ... --short'
        text = """frdm-k64f-gcc 0.1.4: Official mbed build target for the mbed frdm-k64f development board.
frdm-k64f-armcc 0.1.3: Official mbed build target for the mbed frdm-k64f development board, using the armcc toolchain.

additional results from https://yotta-private.herokuapp.com:
"""
        targets = []
        for line in text.splitlines():
            yotta_target_name = mbed_target_info.parse_yotta_search_cmd_output(line)
            if yotta_target_name:
                targets.append(yotta_target_name)
        self.assertIn("frdm-k64f-gcc", targets)
        self.assertIn("frdm-k64f-armcc", targets)
        self.assertEqual(2, len(targets))
Пример #6
0
    def test_parse_yotta_search_cmd_output_new_style_text(self):
        # New style of 'yotta search ...'
        text = """frdm-k64f-gcc 0.1.4
    Official mbed build target for the mbed frdm-k64f development board.
    mbed-target:k64f, mbed-official, k64f, frdm-k64f, gcc
frdm-k64f-armcc 0.1.4
    Official mbed build target for the mbed frdm-k64f development board, using the armcc toolchain.
    mbed-target:k64f, mbed-official, k64f, frdm-k64f, armcc

additional results from https://yotta-private.herokuapp.com:"""
        targets = []
        for line in text.splitlines():
            yotta_target_name = mbed_target_info.parse_yotta_search_cmd_output(line)
            if yotta_target_name:
                targets.append(yotta_target_name)
        self.assertIn("frdm-k64f-gcc", targets)
        self.assertIn("frdm-k64f-armcc", targets)
        self.assertEqual(2, len(targets))
Пример #7
0
    def test_parse_yotta_search_cmd_output_new_style_text_2(self):
        # New style of 'yotta search ...'
        text = """nrf51dk-gcc 0.0.3:
    Official mbed build target for the nRF51-DK 32KB platform.
    mbed-official, mbed-target:nrf51_dk, gcc

additional results from https://yotta-private.herokuapp.com:
  nrf51dk-gcc 0.0.3:
      Official mbed build target for the nRF51-DK 32KB platform.
      mbed-official, mbed-target:nrf51_dk, gcc
  nrf51dk-armcc 0.0.3:
      Official mbed build target for the nRF51-DK 32KB platform.
      mbed-official, mbed-target:nrf51_dk, armcc
"""
        targets = []
        for line in text.splitlines():
            yotta_target_name = mbed_target_info.parse_yotta_search_cmd_output(line)
            if yotta_target_name and yotta_target_name not in targets:
                targets.append(yotta_target_name)

        self.assertIn("nrf51dk-gcc", targets)
        self.assertIn("nrf51dk-armcc", targets)
        self.assertEqual(2, len(targets))
Пример #8
0
 def test_parse_yotta_search_cmd_output_new_style(self):
     self.assertIn("frdm-k64f-gcc", mbed_target_info.parse_yotta_search_cmd_output("frdm-k64f-gcc 0.1.4"))
     self.assertIn("frdm-k64f-armcc", mbed_target_info.parse_yotta_search_cmd_output("frdm-k64f-armcc 0.1.4"))
     pass