Skip to content

showclock/timezones cmd cli formatter#277

Closed
Sreevanich16 wants to merge 2 commits into
Azure:202412from
Sreevanich16:dev/schikkalawar/showclockcmd
Closed

showclock/timezones cmd cli formatter#277
Sreevanich16 wants to merge 2 commits into
Azure:202412from
Sreevanich16:dev/schikkalawar/showclockcmd

Conversation

@Sreevanich16

Copy link
Copy Markdown

What I did

Onboarded show clock/timezones commands formatter which will convert json format to CLI format

How I did it

Used base formatters

How to verify it

PS Q:\src\sonic-utilities.msft> python -m unittest show_gnmi_util.test.test_formatters -v
test_format_basic (show_gnmi_util.test.test_formatters.TestShowClockFormatter.test_format_basic)
Test basic clock formatting ... ok
test_format_different_date (show_gnmi_util.test.test_formatters.TestShowClockFormatter.test_format_different_date)
Test formatting with different date string ... ok
test_format_empty_date (show_gnmi_util.test.test_formatters.TestShowClockFormatter.test_format_empty_date)
Test formatting with missing date ... ok
test_format_basic (show_gnmi_util.test.test_formatters.TestShowClockTimezonesFormatter.test_format_basic)
Test basic timezones formatting ... ok
test_format_empty_timezones (show_gnmi_util.test.test_formatters.TestShowClockTimezonesFormatter.test_format_empty_timezones)
Test formatting with empty timezone list ... ok
test_format_no_timezones_key (show_gnmi_util.test.test_formatters.TestShowClockTimezonesFormatter.test_format_no_timezones_key)
Test formatting when timezones key is missing ... ok
test_format_single_timezone (show_gnmi_util.test.test_formatters.TestShowClockTimezonesFormatter.test_format_single_timezone)
Test formatting with single timezone ... ok
test_format_basic (show_gnmi_util.test.test_formatters.TestShowVersionFormatter.test_format_basic)
Test basic formatting ... ok
test_format_with_docker_images (show_gnmi_util.test.test_formatters.TestShowVersionFormatter.test_format_with_docker_images)
Test formatting with docker images ... ok
test_nil_values (show_gnmi_util.test.test_formatters.TestShowVersionFormatter.test_nil_values)
Test handling of nil values ... ok
test_empty_data (show_gnmi_util.test.test_formatters.TestShowVlanBriefFormatter.test_empty_data)
test_format_basic (show_gnmi_util.test.test_formatters.TestShowVlanBriefFortest_format_basic (show_gnmi_util.test.test_formatters.TestShowVlanBriefFormatter.test_format_basic)
Test basic VLAN formatting ... ok
Test basic VLAN formatting ... ok
test_multiple_ports (show_gnmi_util.test.test_formatters.TestShowVlanBriefFormatter.test_multiple_ports)
Test formatting with multiple ports ... ok


Ran 13 tests in 0.004s

OK

Previous command output (if the output of a command-line utility has changed)

This is new utility, we don't have previous output. The output should be similar to existing CLI, hence pasting CLI o/p =>

New command output (if the output of a command-line utility has changed)

@Sreevanich16 Sreevanich16 changed the base branch from master to 202412 February 2, 2026 06:04
@Sreevanich16

Sreevanich16 commented Feb 2, 2026

Copy link
Copy Markdown
Author

@Sreevanich16 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree company="Microsoft"

@sharmavijay-ms

Copy link
Copy Markdown

1.Please move to 202112 instead of master.
Reason: Master looks outdated and no recent change. Also, we used 202412 for FW P0 development, same branch makes more sense than master.

  1. Use tabulate for conversion.

  2. We need to upload UT test results. For details:
    https://github.com/sonic-net/sonic-utilities?tab=readme-ov-file#to-run-unit-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants