-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"merge main"
- Loading branch information
Showing
57 changed files
with
1,385 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import formatFileSize from './formatFileSize'; | ||
|
||
describe('formatFileSize', () => { | ||
it('returns rounded file size formats for valid inputs', () => { | ||
expect(formatFileSize(0)).toBe('0 bytes'); | ||
expect(formatFileSize(-0)).toBe('0 bytes'); | ||
expect(formatFileSize(1)).toBe('1 bytes'); | ||
expect(formatFileSize(1.5)).toBe('2 bytes'); | ||
|
||
expect(formatFileSize(1023)).toBe('1023 bytes'); | ||
expect(formatFileSize(1024)).toBe('1 KB'); | ||
expect(formatFileSize(1025)).toBe('1 KB'); | ||
|
||
expect(formatFileSize(1535)).toBe('1 KB'); | ||
expect(formatFileSize(1536)).toBe('2 KB'); | ||
expect(formatFileSize(2048)).toBe('2 KB'); | ||
|
||
expect(formatFileSize(Math.pow(2, 20) - 1)).toBe('1024 KB'); | ||
expect(formatFileSize(Math.pow(2, 20))).toBe('1 MB'); | ||
expect(formatFileSize(Math.pow(2, 20) + 1)).toBe('1 MB'); | ||
|
||
expect(formatFileSize(Math.pow(2, 30) - 1)).toBe('1024 MB'); | ||
expect(formatFileSize(Math.pow(2, 30))).toBe('1 GB'); | ||
expect(formatFileSize(Math.pow(2, 30) + 1)).toBe('1 GB'); | ||
}); | ||
|
||
it('throws "Invalid file size" exception for invalid inputs', () => { | ||
expect(() => formatFileSize(Number.MIN_SAFE_INTEGER)).toThrow('Invalid file size'); | ||
expect(() => formatFileSize(-1)).toThrow('Invalid file size'); | ||
expect(() => formatFileSize(NaN)).toThrow('Invalid file size'); | ||
expect(() => formatFileSize(undefined as unknown as number)).toThrow('Invalid file size'); | ||
expect(() => formatFileSize(Math.pow(2, 40))).toThrow('Invalid file size'); // 1TB | ||
expect(() => formatFileSize(Number.MAX_SAFE_INTEGER)).toThrow('Invalid file size'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ export type SearchResult = { | |
created: string; | ||
virusScannerResult: string; | ||
ID: string; | ||
fileSize: number; | ||
}; |
0
lambdas/enums/__init__.py → lambdas/enums/fhir/__init__.py
100755 → 100644
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from enum import Enum | ||
|
||
|
||
class FhirIssueCoding(Enum): | ||
INVALID = ("invalid", "Invalid") | ||
FORBIDDEN = ("forbidden", "Forbidden") | ||
NOT_FOUND = ("not-found", "Not Found") | ||
EXCEPTION = ("exception", "Exception") | ||
UNKNOWN = ("unknown", "Unknown User") | ||
|
||
def code(self): | ||
return self.value[0] | ||
|
||
def display(self): | ||
return self.value[1] |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.