Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/pip-60b803aef9
Browse files Browse the repository at this point in the history
  • Loading branch information
ouhammmourachid authored Jul 20, 2024
2 parents db058e7 + 45b7c92 commit bdaf9e1
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: deploy docs
on:
push:
branches:
- docs/*
- main
paths:
- 'docs/**'

workflow_dispatch:

Expand Down
8 changes: 4 additions & 4 deletions mermaid/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
class Icon:
name: str
type_: str
str_: str = 'v1'
version: str = 'v1'

def __str__(self) -> str:
if self.str_ == 'v1':
return f'{self.type_} {self.name}'
elif self.str_ == 'v2':
if self.version == 'v1':
return f'{self.type_} {self.name}'
elif self.version == 'v2':
return f'{self.type_}:{self.name}'
return f' {self.type_}:{self.name} '
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions tests/test_icon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import unittest

from mermaid.icon import Icon


class TestIcon(unittest.TestCase):
def setUp(self) -> None:
self.icon_v1 = Icon('icon', 'fa')
self.icon_v2 = Icon('icon', 'fa', version='v2')
self.icon_v3 = Icon('icon', 'fa', version='v3')

def test_str(self):
self.assertEqual(str(self.icon_v1), 'fa icon')
self.assertEqual(str(self.icon_v2), 'fa:icon')
self.assertEqual(str(self.icon_v3), ' fa:icon ')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit bdaf9e1

Please sign in to comment.