Skip to content

Commit 2ceaaef

Browse files
committed
Added minimalistic unit test.
1 parent a0bd8b4 commit 2ceaaef

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

tests/unit/Vivado.py

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# ==================================================================================================================== #
2+
# _____ ____ _ _ _ _ #
3+
# _ __ _ _| ____| _ \ / \ / \ | | __ _ _ _ _ __ ___| |__ ___ _ __ #
4+
# | '_ \| | | | _| | | | |/ _ \ / _ \ | | / _` | | | | '_ \ / __| '_ \ / _ \ '__| #
5+
# | |_) | |_| | |___| |_| / ___ \ / ___ \ _| |__| (_| | |_| | | | | (__| | | | __/ | #
6+
# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)_____\__,_|\__,_|_| |_|\___|_| |_|\___|_| #
7+
# |_| |___/ #
8+
# ==================================================================================================================== #
9+
# Authors: #
10+
# Patrick Lehmann #
11+
# #
12+
# License: #
13+
# ==================================================================================================================== #
14+
# Copyright 2017-2022 Patrick Lehmann - Bötzingen, Germany #
15+
# #
16+
# Licensed under the Apache License, Version 2.0 (the "License"); #
17+
# you may not use this file except in compliance with the License. #
18+
# You may obtain a copy of the License at #
19+
# #
20+
# http://www.apache.org/licenses/LICENSE-2.0 #
21+
# #
22+
# Unless required by applicable law or agreed to in writing, software #
23+
# distributed under the License is distributed on an "AS IS" BASIS, #
24+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
25+
# See the License for the specific language governing permissions and #
26+
# limitations under the License. #
27+
# #
28+
# SPDX-License-Identifier: Apache-2.0 #
29+
# ==================================================================================================================== #
30+
#
31+
"""Unit tests for Vivado."""
32+
from pathlib import Path
33+
from unittest import TestCase
34+
35+
from pyEDAA.Launcher import get_version
36+
37+
38+
class ReadXPRFile(TestCase):
39+
def test_ExtractVersionFromXPRFile(self):
40+
xprFilePath = Path("StopWatch.xpr")
41+
version = get_version(xprFilePath)
42+
43+
self.assertEqual("2021.2", version)

tests/unit/__init__.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# ==================================================================================================================== #
2+
# _____ ____ _ _ _ _ #
3+
# _ __ _ _| ____| _ \ / \ / \ | | __ _ _ _ _ __ ___| |__ ___ _ __ #
4+
# | '_ \| | | | _| | | | |/ _ \ / _ \ | | / _` | | | | '_ \ / __| '_ \ / _ \ '__| #
5+
# | |_) | |_| | |___| |_| / ___ \ / ___ \ _| |__| (_| | |_| | | | | (__| | | | __/ | #
6+
# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)_____\__,_|\__,_|_| |_|\___|_| |_|\___|_| #
7+
# |_| |___/ #
8+
# ==================================================================================================================== #
9+
# Authors: #
10+
# Patrick Lehmann #
11+
# #
12+
# License: #
13+
# ==================================================================================================================== #
14+
# Copyright 2017-2022 Patrick Lehmann - Bötzingen, Germany #
15+
# #
16+
# Licensed under the Apache License, Version 2.0 (the "License"); #
17+
# you may not use this file except in compliance with the License. #
18+
# You may obtain a copy of the License at #
19+
# #
20+
# http://www.apache.org/licenses/LICENSE-2.0 #
21+
# #
22+
# Unless required by applicable law or agreed to in writing, software #
23+
# distributed under the License is distributed on an "AS IS" BASIS, #
24+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
25+
# See the License for the specific language governing permissions and #
26+
# limitations under the License. #
27+
# #
28+
# SPDX-License-Identifier: Apache-2.0 #
29+
# ==================================================================================================================== #
30+
#
31+
"""Helper classes for unit tests."""

0 commit comments

Comments
 (0)