| 135 | |
| 136 | |
| 137 | def test_system_info(): |
| 138 | schema = Schema({"os": Any("windows", "mac", "linux")}, required=True) |
| 139 | |
| 140 | system = platform.system() |
| 141 | |
| 142 | if system == "Windows": |
| 143 | schema = schema.extend( |
| 144 | { |
| 145 | "windows_version_build": int, |
| 146 | "windows_version_major": int, |
| 147 | "windows_version_minor": int, |
| 148 | "windows_version_service_pack": str, |
| 149 | } |
| 150 | ) |
| 151 | |
| 152 | if system == "Darwin": |
| 153 | schema = schema.extend({"mac_version": str}) |
| 154 | |
| 155 | if system == "Linux": |
| 156 | schema = schema.extend( |
| 157 | { |
| 158 | "linux_distro": str, |
| 159 | "linux_distro_like": str, |
| 160 | "linux_distro_version": str, |
| 161 | } |
| 162 | ) |
| 163 | |
| 164 | assert schema(analytics._system_info()) |
| 165 | |
| 166 | |
| 167 | @pytest.mark.parametrize( |